You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self):
super().__init__()
self.setupUi(self)
def initUI(self):
print("UI inited: MainWindow")
self.SaveButton.clicked.connect(self.OnBttClicked_Save)
switch_control = SwitchControl()
hbox = QHBoxLayout()
hbox.addWidget(switch_control, Qt.AlignCenter, Qt.AlignCenter)
self.setLayout(hbox)
if __name__ == "__main__":
app = QApplication([])
form_MainWindow = MainWindow() ###<-- in here a try to create the SwitchControl - like in your example
form_MainWindow.show()
sys.exit(app.exec())
Ui_MainWindow is a Window made in QT Designer:
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
if not MainWindow.objectName():
MainWindow.setObjectName(u"MainWindow")
MainWindow.resize(823, 656)
.
. #Design code goes here
.
I allways get the Exception: QWidget: Must construct a QApplication before a QWidget
The text was updated successfully, but these errors were encountered:
I currently start the programm like so:
Ui_MainWindow is a Window made in QT Designer:
I allways get the Exception: QWidget: Must construct a QApplication before a QWidget
The text was updated successfully, but these errors were encountered: