-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
I currently start the programm like so:
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
Metadata
Metadata
Assignees
Labels
No labels