Closing of popups in QWidgetWindow.
authorSamuel Rødal <samuel.rodal@nokia.com>
Wed, 4 May 2011 12:35:24 +0000 (14:35 +0200)
committerSamuel Rødal <samuel.rodal@nokia.com>
Wed, 4 May 2011 12:35:36 +0000 (14:35 +0200)
src/gui/kernel/qapplication.h
src/gui/kernel/qwidgetwindow_qpa.cpp

index b045dc3..fc0ab64 100644 (file)
@@ -389,6 +389,7 @@ private:
     friend class QGraphicsScenePrivate;
     friend class QWidget;
     friend class QWidgetPrivate;
+    friend class QWidgetWindow;
     friend class QETWidget;
     friend class Q3AccelManager;
     friend class QTranslator;
index 3e06289..e02c2cf 100644 (file)
@@ -112,7 +112,10 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
     // which child should have it?
     QWidget *widget = m_implicit_mouse_grabber ? m_implicit_mouse_grabber.data() : m_widget->childAt(event->pos());
 
-    // TODO: make sure mouse release is delivered to same widget that got the press event
+    if (qApp->d_func()->inPopupMode()) {
+        widget = qApp->activePopupWidget();
+        m_implicit_mouse_grabber.clear();
+    }
 
     if (!widget)
         widget = m_widget;