X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Ftracegroup.cpp;h=87f1ff3dcab20fac2c065a5daadb0525534e56f8;hp=74221d440a15331a0ac657cadab0b3cf88b8399d;hb=af503b104d890a357c736c678bb00296d889c090;hpb=dbf74f26f6bd9fd5277f090fea8e4f5506c19911 diff --git a/pv/view/tracegroup.cpp b/pv/view/tracegroup.cpp index 74221d44..87f1ff3d 100644 --- a/pv/view/tracegroup.cpp +++ b/pv/view/tracegroup.cpp @@ -49,7 +49,7 @@ TraceGroup::~TraceGroup() bool TraceGroup::enabled() const { return std::any_of(child_items().begin(), child_items().end(), - [](const shared_ptr &r) { return r->enabled(); }); + [](const shared_ptr &r) { return r->enabled(); }); } pv::Session& TraceGroup::session() @@ -78,7 +78,7 @@ const pv::view::View* TraceGroup::view() const pair TraceGroup::v_extents() const { - return RowItemOwner::v_extents(); + return TraceTreeItemOwner::v_extents(); } void TraceGroup::paint_label(QPainter &p, const QRect &rect, bool hover) @@ -115,7 +115,7 @@ void TraceGroup::paint_label(QPainter &p, const QRect &rect, bool hover) QRectF TraceGroup::label_rect(const QRectF &rect) const { QRectF child_rect; - for (const shared_ptr r : child_items()) + for (const shared_ptr r : child_items()) if (r && r->enabled()) child_rect = child_rect.united(r->label_rect(rect)); @@ -157,12 +157,12 @@ int TraceGroup::owner_visual_v_offset() const void TraceGroup::restack_items() { - vector< shared_ptr > items( + vector< shared_ptr > items( child_items().begin(), child_items().end()); // Sort by the centre line of the extents stable_sort(items.begin(), items.end(), - [](const shared_ptr &a, const shared_ptr &b) { + [](const shared_ptr &a, const shared_ptr &b) { const auto aext = a->v_extents(); const auto bext = b->v_extents(); return a->layout_v_offset() + @@ -172,7 +172,7 @@ void TraceGroup::restack_items() }); int total_offset = 0; - for (shared_ptr r : items) { + for (shared_ptr r : items) { const pair extents = r->v_extents(); if (extents.first == 0 && extents.second == 0) continue; @@ -197,11 +197,11 @@ unsigned int TraceGroup::depth() const void TraceGroup::ungroup() { - const vector< shared_ptr > items( + const vector< shared_ptr > items( child_items().begin(), child_items().end()); clear_child_items(); - for (shared_ptr r : items) + for (shared_ptr r : items) owner_->add_child_item(r); owner_->remove_child_item(shared_from_this());