From: Joel Holdsworth Date: Tue, 1 Sep 2015 01:52:33 +0000 (-0600) Subject: Viewport: Render all types of RowItem X-Git-Tag: pulseview-0.3.0~77 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e94f43c6539a9ec9412829550d8f025902ccc341;p=pulseview.git Viewport: Render all types of RowItem --- diff --git a/pv/view/viewport.cpp b/pv/view/viewport.cpp index c55e76a2..91b27d3f 100644 --- a/pv/view/viewport.cpp +++ b/pv/view/viewport.cpp @@ -96,10 +96,9 @@ void Viewport::drag_release() vector< shared_ptr > Viewport::items() { vector< shared_ptr > items; - const vector< shared_ptr > trace_tree_items( - view_.list_by_type()); - copy(trace_tree_items.begin(), trace_tree_items.end(), - back_inserter(items)); + const std::vector< shared_ptr > view_items( + view_.list_by_type()); + copy(view_items.begin(), view_items.end(), back_inserter(items)); const vector< shared_ptr > time_items(view_.time_items()); copy(time_items.begin(), time_items.end(), back_inserter(items)); return items; @@ -152,14 +151,13 @@ bool Viewport::touch_event(QTouchEvent *event) void Viewport::paintEvent(QPaintEvent*) { - vector< shared_ptr > trace_tree_items( - view_.list_by_type()); - assert(none_of(trace_tree_items.begin(), trace_tree_items.end(), - [](const shared_ptr &r) { return !r; })); + vector< shared_ptr > row_items(view_.list_by_type()); + assert(none_of(row_items.begin(), row_items.end(), + [](const shared_ptr &r) { return !r; })); - stable_sort(trace_tree_items.begin(), trace_tree_items.end(), - [](const shared_ptr &a, const shared_ptr &b) { - return a->visual_v_offset() < b->visual_v_offset(); }); + stable_sort(row_items.begin(), row_items.end(), + [](const shared_ptr &a, const shared_ptr &b) { + return a->point(QRect()).y() < b->point(QRect()).y(); }); const vector< shared_ptr > time_items(view_.time_items()); assert(none_of(time_items.begin(), time_items.end(), @@ -172,17 +170,17 @@ void Viewport::paintEvent(QPaintEvent*) for (const shared_ptr t : time_items) t->paint_back(p, pp); - for (const shared_ptr r : trace_tree_items) + for (const shared_ptr r : row_items) r->paint_back(p, pp); for (const shared_ptr t : time_items) t->paint_mid(p, pp); - for (const shared_ptr r : trace_tree_items) + for (const shared_ptr r : row_items) r->paint_mid(p, pp); p.setRenderHint(QPainter::Antialiasing, false); - for (const shared_ptr r : trace_tree_items) + for (const shared_ptr r : row_items) r->paint_fore(p, pp); for (const shared_ptr t : time_items) t->paint_fore(p, pp);