From: Joel Holdsworth Date: Sun, 30 Aug 2015 15:52:37 +0000 (-0600) Subject: Header: Added drag-handling support for non-TraceTreeItems X-Git-Tag: pulseview-0.3.0~71 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=83d8efb578f191554509161e8a555fbe9475b1f6;p=pulseview.git Header: Added drag-handling support for non-TraceTreeItems --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index bfb75532..7c2dd9b0 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -105,17 +105,17 @@ void Header::paintEvent(QPaintEvent*) // would be clipped away. const QRect rect(0, 0, width() - BaselineOffset, height()); - vector< shared_ptr > items( - view_.list_by_type()); + vector< shared_ptr > items( + view_.list_by_type()); stable_sort(items.begin(), items.end(), - [](const shared_ptr &a, const shared_ptr &b) { - return a->visual_v_offset() < b->visual_v_offset(); }); + [](const shared_ptr &a, const shared_ptr &b) { + return a->point(QRect()).y() < b->point(QRect()).y(); }); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); - for (const shared_ptr r : items) + for (const shared_ptr r : items) { assert(r);