Answer the question
In order to leave comments, you need to log in
How to fix pyqt error?
I get an error:
Must construct a QApplication before a QWidget
main.py:
import sys
from PySide6.QtWidgets import QApplication, QMainWindow
from windows.mainWindow import MainWindow
if __name__ == '__main__':
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec())
from PyQt5.QtWidgets import QMainWindow
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.setWindowTitle('MainWindow')
Answer the question
In order to leave comments, you need to log in
class MainWindow(QMainWindow):
def __init__(self):
super(QMainWindow, self).__init__()
self.setWindowTitle('MainWindow')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question