[PyQt] QMessageBox does not get focus

Mads Ipsen mpi at comxnet.dk
Sun Sep 27 15:57:03 BST 2009


When I launch a QMessageBox like below, from a QMainWindow the box does 
not have keyboard focus (its not the active window), implying that the 
key-shortcuts cannot be used. Any fixes or suggestions?

Mads

QtGui.QMessageBox.warning(self, 'Some title',
                                self.tr("The document has been modified.\n"
                                        "Do you want to save your 
changes?"),
                                QtGui.QMessageBox.Yes | 
QtGui.QMessageBox.Default,
                                QtGui.QMessageBox.No,
                                QtGui.QMessageBox.Cancel | 
QtGui.QMessageBox.Escape)

-- 
+------------------------------------------------------------+
| Mads Ipsen, Scientific developer                           |
+------------------------------+-----------------------------+
| QuantumWise A/S              | phone:         +45-29716388 |
| Nørresøgade 27A              | www:    www.quantumwise.com |
| DK-1370 Copenhagen, Denmark  | email:  mpi at quantumwise.com |
+------------------------------+-----------------------------+




More information about the PyQt mailing list