summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication_p.h
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2016-03-03 13:51:19 -0800
committerGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2016-03-09 23:46:50 +0000
commit85a57f7a2e85ac61bb65e66b003cb21f58d5a5b7 (patch)
tree3db67f421037ed2e7a8100c85f47d9d4c5b2d934 /src/widgets/kernel/qapplication_p.h
parent2020d2cb63b851723e188c002acbe25b5f066525 (diff)
Wheel event widget: Harden logic an extra bit
This is quite an unlikely scenario, but not impossible. It could be that the wheel widget is destroyed during an update phase event. In that case, wheel_widget would be a dangling pointer for any subsequent wheel event. We protect against this with a QPointer. However, that would mean that if the next wheel event were to be an end phase event, that event would be lost. So we go through the usual code path, except that we won't set wheel_widget in the case of an end phase event. Change-Id: I59a912b845dcc249e1edc60b4dc28bf308d807d9 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/widgets/kernel/qapplication_p.h')
-rw-r--r--src/widgets/kernel/qapplication_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index 832d37a329..4b3cf773dc 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -202,7 +202,7 @@ public:
static QWidget *active_window;
#ifndef QT_NO_WHEELEVENT
static int wheel_scroll_lines;
- static QWidget *wheel_widget;
+ static QPointer<QWidget> wheel_widget;
#endif
static int enabledAnimations; // Combination of QPlatformTheme::UiEffect