Mac: QComboBox wouldn't receive mouse events when shown within a modal dialog
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Mon, 1 Oct 2012 17:16:04 +0000 (19:16 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 3 Oct 2012 15:30:52 +0000 (17:30 +0200)
The mouse events were being stolen by the modal dialog, preventing the
combo box to update itself. Key events were being properly forwarded,
but this was probably due to the different way key events are being
delivered.

Change-Id: I5bfc4800fad9fd4122a212e6fdec13811a7e647b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
src/plugins/platforms/cocoa/qcocoawindow.mm

index 4ef445c..1524c71 100644 (file)
@@ -291,6 +291,10 @@ void QCocoaWindow::setVisible(bool visible)
                 } else {
                     [m_nsWindow orderFront: nil];
                 }
+
+                // We want the events to properly reach the popup
+                if (window()->windowType() == Qt::Popup)
+                    [(NSPanel *)m_nsWindow setWorksWhenModal:YES];
             }
         }
     } else {