[PyQt] PyQt 4 modeless dialog issue

Stephen Funkhouser stephen at ddssoft.com
Fri Oct 18 16:21:52 BST 2013


I'm trying to use a dialog created with QtDesigner as a modeless
dialog.  The problem I'm having is that when I use the .show() method to
display the dialog modeless it creates the dialog but it doesn't create
the label on the dialog. 

I've tested it as a modal dialog using .exec_() and the label is
displayed properly.


import ConverterWindowPacifierDialogUI
from PyQt4 import QtCore,QtGui

# Create a class for A-Shell Code Generator Dialog Single
class PacifierDialog(QtGui.QDialog):
    """
        pass
    """
    def __init__(self, parent=None):
        super(PacifierDialog, self).__init__(parent)
       
        # This is always the same
        self.ui=ConverterWindowPacifierDialogUI.Ui_DialogPacifier()
        self.ui.setupUi(self)

if __name__ == "__main__":
    import sys
    from PyQt4.QtGui import QApplication
    app = QApplication(sys.argv)
    dlg = PacifierDialog()
    dlg.show()

    # sleep to verify the display of the dialog
    from time import sleep
    sleep(2)

-- 
Stephen Funkhouser
Diversified Data Solutions, Inc.
(775) 238-3865 Google Voice



More information about the PyQt mailing list