[PyQt] Problem with class inheriting QDialog
phil at riverbankcomputing.com
Thu Nov 19 22:43:49 GMT 2009
On Thu, 19 Nov 2009 13:45:31 -0800 (PST), dizou <di_zou at yahoo.com> wrote:
> 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
> class MainWindow(QMainWindow):
> def __init__(self):
> def MyFunction():
> dialog = Dialog(self)
> print type(dialog)
> 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?
First you post a short, complete example program that demonstrates the
Then we point out the bug in your example.
More information about the PyQt