summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorten Johan Sorvig <morten.sorvig@nokia.com>2012-09-21 10:09:30 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-19 22:14:52 +0200
commit1279045ab270cdd34af0a41aa7642593aa93d19b (patch)
tree0fdefa5f87c0d60ae3b2f41e28586a3ad6969768 /src
parent4b7b6f20248e43337103fc2c52f9fc40c5ca83af (diff)
Close popups on non-client area mouse press.
Fixed QComboBox popup issue which was left open if window was moved(dragged) to another position. Task-number: QTBUG-1894 Task-number: QTBUG-26120 Task-number: QTBUG-26465 Task-number: QTBUG-26827 Change-Id: I7e37b37881cdf94574d79f7e77d36f5bbc15f732 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwidget.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index ac75b9e085..43fe26cb0d 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -8374,6 +8374,17 @@ bool QWidget::event(QEvent *event)
case QEvent::MouseButtonDblClick:
mouseDoubleClickEvent((QMouseEvent*)event);
break;
+
+ case QEvent::NonClientAreaMouseButtonPress: {
+ QWidget* w;
+ while ((w = QApplication::activePopupWidget()) && w != this) {
+ w->close();
+ if (QApplication::activePopupWidget() == w) // widget does not want to disappear
+ w->hide(); // hide at least
+ }
+ break;
+ }
+
#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel:
wheelEvent((QWheelEvent*)event);