Open a second window in PyQt

前端 未结 3 684
野趣味
野趣味 2021-02-02 01:23

I\'m trying to use pyqt to show a custom QDialog window when a button on a QMainWindow is clicked. I keep getting the following error:

$ python main.py 
DEBUG:          


        
3条回答
  •  庸人自扰
    2021-02-02 02:00

    Ui_Dialog should inherent from QtGui.QDialog, not object.

    class Ui_Dialog(QtGui.QDialog):
        def __init__(self, dbConnection):
            QtGui.QDialog.__init__(self)
            global c
            c = dbConnection
    

提交回复
热议问题