From: Joel Holdsworth Date: Sat, 22 Mar 2014 10:20:44 +0000 (+0000) Subject: Header/Viewport: Manually trigger the signals_changed event at construction X-Git-Tag: pulseview-0.2.0~11 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=9f46d9058be2cc2b11ccecb0ba4c4f61d55bec1a Header/Viewport: Manually trigger the signals_changed event at construction This fixes #338 --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index af67abdd..a7902521 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -59,6 +59,10 @@ Header::Header(View &parent) : 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(); } QSize Header::sizeHint() const diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 21954333..d1174895 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -123,6 +123,8 @@ View::View(SigSession &session, QWidget *parent) : _ruler->installEventFilter(this); _header->installEventFilter(this); + // Trigger the initial event manually. The default device has signals + // which were created before this object came into being signals_changed(); } diff --git a/pv/view/viewport.cpp b/pv/view/viewport.cpp index e9a14422..3b06cf9e 100644 --- a/pv/view/viewport.cpp +++ b/pv/view/viewport.cpp @@ -49,6 +49,10 @@ Viewport::Viewport(View &parent) : 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