Skip to content Skip to sidebar Skip to footer

Ui_mainwindow' Object Has No Attribute 'connect'

I am new to PyQt. I want the GUI to be GUI1 from time 0 to time t1, GUI2 from time t1 to t2, ..., GUIn from time t(n-1) to t(n). So I thought I would have to use the multithreading

Solution 1:

You're using the Ui_MainWindow class incorrectly. See this answer for how to use the auto-generated UI classes.

You should be either inheriting from the UI class, or setting it as an instance attribute on one of your own classes.

classMainWIndow(QtGui.QMainWIndow,Ui_MainWindow):

    def__init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)                
        self.setupUi(self)

Sometimes, people won't inherit, but will assign it to an attribute of the class:

classMainWIndow(QtGui.QMainWIndow):

    def__init__(self, parent=None):
        QtGui.QMainWIndow.__init__(self, parent)                
        self.ui = Ui_MainWindow(self)
        self.ui.setupUi(self)

Solution 2:

So although nobody wants to give the answer to this question, I think I found the answer from another question asked by me in Update GUI at different time interval in QT.

I hope someone could give me the pyqt version of this answer because this is in C++.

Post a Comment for "Ui_mainwindow' Object Has No Attribute 'connect'"