From: Soeren Apel Date: Wed, 25 Jul 2018 11:19:56 +0000 (+0200) Subject: Fix #1204 by making sure the lazy event handler is fired X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=68e0a53ee49c6a58fe1fadd8b9dc12572cc0dbd0 Fix #1204 by making sure the lazy event handler is fired 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. --- diff --git a/pv/views/trace/view.cpp b/pv/views/trace/view.cpp index 98fd46d2..024e3bf4 100644 --- a/pv/views/trace/view.cpp +++ b/pv/views/trace/view.cpp @@ -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(); }