]> sigrok.org Git - pulseview.git/blobdiff - pv/view/viewport.cpp
RowItemOwner: Replaced parent notification scheme
[pulseview.git] / pv / view / viewport.cpp
index c0e9a69e3679f4796512160918b60136817c5ac7..eeca690da0e45cb4efb96bbfc619082ab9d6234b 100644 (file)
@@ -52,23 +52,8 @@ Viewport::Viewport(View &parent) :
        setAutoFillBackground(true);
        setBackgroundRole(QPalette::Base);
 
-       connect(&_view.session(), SIGNAL(signals_changed()),
-               this, SLOT(on_signals_changed()));
-
        connect(&_view, SIGNAL(signals_moved()),
                this, SLOT(on_signals_moved()));
-
-       // Trigger the initial event manually. The default device has signals
-       // which were created before this object came into being
-       on_signals_changed();
-}
-
-int Viewport::get_total_height() const
-{
-       int h = 0;
-       for (auto &i : _view)
-               h = max(i->v_offset() + View::SignalHeight, h);
-       return h;
 }
 
 void Viewport::paintEvent(QPaintEvent*)
@@ -76,7 +61,7 @@ void Viewport::paintEvent(QPaintEvent*)
        vector< shared_ptr<RowItem> > row_items(_view.begin(), _view.end());
        stable_sort(row_items.begin(), row_items.end(),
                [](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
-                       return a->v_offset() < b->v_offset(); });
+                       return a->visual_v_offset() < b->visual_v_offset(); });
 
        QPainter p(this);
        p.setRenderHint(QPainter::Antialiasing);
@@ -229,15 +214,6 @@ bool Viewport::touchEvent(QTouchEvent *event)
        return true;
 }
 
-void Viewport::on_signals_changed()
-{
-       for (shared_ptr<RowItem> r : _view) {
-               assert(r);
-               connect(r.get(), SIGNAL(visibility_changed()),
-                       this, SLOT(update()));
-       }
-}
-
 void Viewport::on_signals_moved()
 {
        update();