]> sigrok.org Git - pulseview.git/commitdiff
Header: Added drag-handling support for non-TraceTreeItems
authorJoel Holdsworth <redacted>
Sun, 30 Aug 2015 15:52:37 +0000 (09:52 -0600)
committerJoel Holdsworth <redacted>
Sun, 18 Oct 2015 21:32:30 +0000 (15:32 -0600)
pv/view/header.cpp

index bfb75532aa58ad7508db13b1243ce051613e131c..7c2dd9b0d7b17c1d698bf36bd7a8db8181ea13ec 100644 (file)
@@ -105,17 +105,17 @@ void Header::paintEvent(QPaintEvent*)
        // would be clipped away.
        const QRect rect(0, 0, width() - BaselineOffset, height());
 
-       vector< shared_ptr<TraceTreeItem> > items(
-               view_.list_by_type<TraceTreeItem>());
+       vector< shared_ptr<RowItem> > items(
+               view_.list_by_type<RowItem>());
 
        stable_sort(items.begin(), items.end(),
-               [](const shared_ptr<TraceTreeItem> &a, const shared_ptr<TraceTreeItem> &b) {
-                       return a->visual_v_offset() < b->visual_v_offset(); });
+               [](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
+                       return a->point(QRect()).y() < b->point(QRect()).y(); });
 
        QPainter painter(this);
        painter.setRenderHint(QPainter::Antialiasing);
 
-       for (const shared_ptr<TraceTreeItem> r : items)
+       for (const shared_ptr<RowItem> r : items)
        {
                assert(r);