[PyQt] stuck on non-modal dialog

David J Brooks daeg at houston.rr.com
Wed May 23 02:20:39 BST 2007


I'm sure I must be overlooking something obvious, but I don't see it.

Ive set up a main window for MDI and added a Find dialog, with signals and 
slots to activate it. The dialog pops up as expected, but is totally 
unresponsive. Nothing typing into its lineEdit does nothing, buttons don't 
seem to 'click'  etc. Worse, it seems to hang the application, requiring a 
killall -9 python to close it. What am I not seeing?
 
class MainWindow(QtGui.QMainWindow):
    def __init__(self, fileName=None, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.ui=Ui_MainWindow()
        self.ui.setupUi(self)
        self.workspace=QtGui.QWorkspace(self)
        self.setCentralWidget(self.workspace)
        self.finder=findDialog()
        self.connect(self.ui.actionFind, QtCore.SIGNAL("triggered()"), 
self.findWord)

    def findWord(self):
        self.finder.show()
        self.workspace.setActiveWindow(self.finder)


class findDialog(QtGui.QDialog):
    def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.ui=Ui_findDialog()
        self.ui.setupUi(self)
        self.setModal=(False)

    @QtCore.pyqtSignature("")
    def on_closeButton_clicked(self): self.hide()
    @QtCore.pyqtSignature("")
    def on_searchButton_clicked(self): self.search()


David
-- 
The best way to accelerate Windows is at 9.8 meters per second, squared.


More information about the PyQt mailing list