X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fheader.cpp;h=5e978a70252565cf47f4a3bb95712707a813842d;hb=68b21a71797051fb48ed272bc2a6b4893bdbf517;hp=361a60c138208911ce5bf044c685f8d0c4a3d52a;hpb=bd9a1f175057487cff3cb3cc62bc9595e19945be;p=pulseview.git diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 361a60c..5e978a7 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -24,7 +24,8 @@ #include "signal.h" #include "../sigsession.h" -#include +#include +#include #include #include @@ -38,6 +39,7 @@ using std::max; using std::make_pair; using std::pair; using std::shared_ptr; +using std::stable_sort; using std::vector; namespace pv { @@ -112,7 +114,11 @@ void Header::paintEvent(QPaintEvent*) // left edge of the widget, because then the selection shadow // would be clipped away. const int w = width() - BaselineOffset; - const vector< shared_ptr > row_items(_view.child_items()); + + vector< shared_ptr > row_items(_view.child_items()); + stable_sort(row_items.begin(), row_items.end(), + [](const shared_ptr &a, const shared_ptr &b) { + return a->v_offset() < b->v_offset(); }); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing);