path: root/src
diff options
authorOliver Wolff <>2012-10-17 15:50:01 +0200
committerThe Qt Project <>2012-11-08 15:01:52 +0100
commitd2e5c7787e82fe3157ca3100a0e465a0ed7c5685 (patch)
tree5adb0ff24e55e0487be836299e1131d6dcc96396 /src
parenta6f49a4223dcfdfb92889d26323783342e50d9a2 (diff)
Do not call QWidget::show/hideEvent twice
While handling events for Widgets and Windows in QWidgetWindow::event makes sense for other events, it causes QWidget::show/hideEvent to be called twice when handled like "the rest". Having that as one case here seems to be the cleanest solution. Removing the call to showEvent from QWidgetPrivate::show_helper (as proposed in the bug report) causes autotests to fail and thus is not a viable option. Additionally the expected result for the task221221 test for QDoubleSpinBox was reverted to the Qt4 value as Qt4 behaviour was restored. Task-number: QTBUG-27199 Task-number: QTBUG-26424 Task-number: QTBUG-22565 Change-Id: I0ac42b09b1a7618de042d27aa5dd1b3d9f30f552 Reviewed-by: Friedemann Kleint <> Reviewed-by: Andy Shaw <>
Diffstat (limited to 'src')
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 94e851ac4c..1cabb095ec 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -205,6 +205,12 @@ bool QWidgetWindow::event(QEvent *event)
handleContextMenuEvent(static_cast<QContextMenuEvent *>(event));
return true;
+ // Handing show events to widgets (see below) here would cause them to be triggered twice
+ case QEvent::Show:
+ case QEvent::Hide:
+ return QWindow::event(event);