diff options
author | Morten Johan Sorvig <morten.sorvig@nokia.com> | 2012-09-21 08:09:30 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-19 20:14:52 (GMT) |
commit | 1279045ab270cdd34af0a41aa7642593aa93d19b (patch) | |
tree | 0fdefa5f87c0d60ae3b2f41e28586a3ad6969768 | |
parent | 4b7b6f20248e43337103fc2c52f9fc40c5ca83af (diff) | |
download | Qt-1279045ab270cdd34af0a41aa7642593aa93d19b.zip Qt-1279045ab270cdd34af0a41aa7642593aa93d19b.tar.gz Qt-1279045ab270cdd34af0a41aa7642593aa93d19b.tar.bz2 |
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>
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index ac75b9e..43fe26c 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); |