Fix #1204 by making sure the lazy event handler is fired
authorSoeren Apel <soeren@apelpie.net>
Wed, 25 Jul 2018 11:19:56 +0000 (13:19 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Tue, 21 Aug 2018 10:02:38 +0000 (12:02 +0200)
The QTimer reference says about QTimer::start():

> Starts or restarts the timer with the timeout specified in interval.
> If the timer is already running, it will be stopped and restarted.
> If singleShot is true, the timer will be activated only once.

This suggests that the timer is reset when start() is called even
when it is in single shot mode. However, this is actually not the case
and start() doesn't appear to be doing anything if it has already
been started. While this works in most cases, it causes issues when
the timer is supposed to be reset and timeout at the specified time
since view items are still in flux.

Adding a stop() before the start() fixes this.

pv/views/trace/view.cpp

index 98fd46d2ad4684fb81051956c0995f579abc49d0..024e3bf48d665b0043252551c72ef2202da80de5 100644 (file)
@@ -1297,6 +1297,7 @@ void View::extents_changed(bool horz, bool vert)
                (horz ? TraceTreeItemHExtentsChanged : 0) |
                (vert ? TraceTreeItemVExtentsChanged : 0);
 
+       lazy_event_handler_.stop();
        lazy_event_handler_.start();
 }