aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@viroteck.net>2015-11-06 21:24:48 +0100
committerRobin Burchell <robin.burchell@viroteck.net>2015-12-07 18:36:36 +0000
commit72e889d12f9df162a22c39204c8333c5f4808da8 (patch)
tree8e076280ce7dd21e9d0532bbbc2334dd326d5e6f /src/quickwidgets
parentc3cb4e6f2a82ea805b3d102229dbe154a88e1fde (diff)
QSGRenderLoop: Remove the exhaust delay timer.
This was replaced by a proper requestUpdate mechanism at the QWindow level, so it isn't needed anymore. As we can't remove the QQuickWidget version so easily, document the exhaust_delay reasoning, as it is not too obvious. Change-Id: I0a15237bacae47dc87af6b6018a7bc1b47eb8d2d Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quickwidgets')
-rw-r--r--src/quickwidgets/qquickwidget.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 063386ed8e..6a29dea505 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -1280,6 +1280,14 @@ void QQuickWidget::triggerUpdate()
Q_D(QQuickWidget);
d->updatePending = true;
if (!d->eventPending) {
+ // There's no sense in immediately kicking a render off now, as
+ // there may be a number of triggerUpdate calls to come from a multitude
+ // of different sources (network, touch/mouse/keyboard, timers,
+ // animations, ...), and we want to batch them all into single frames as
+ // much as possible for the sake of interactivity and responsiveness.
+ //
+ // To achieve this, we set a timer and only perform the rendering when
+ // this is complete.
const int exhaustDelay = 5;
d->updateTimer.start(exhaustDelay, Qt::PreciseTimer, this);
d->eventPending = true;