I have a class Dialog inheriting a QDialog:

def Dialog(QDialog):
        def __init__(self, parent):
                QDialog.__init__(self, parent)

I have a MainWindow class that inherits QMainWindow that creates the Dialog
class:

class MainWindow(QMainWindow):
    def __init__(self):
        #stuff
    def MyFunction():
        dialog = Dialog(self)
        print type(dialog)
        dialog.exec_()

When MyFunction is called I get this output and error:

<type 'NoneType'>
...
AttributeError: 'NoneType' object has no attribute 'exec_'

I guess the QDialog isn't being initialized right? How do I fix this?
-- 
View this message in context: 
http://old.nabble.com/Problem-with-class-inheriting-QDialog-tp26421493p26421493.html
Sent from the PyQt mailing list archive at Nabble.com.

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to