[Python] PySide6.QtWidgets.QWidget crashes on super().__init__()

Discussão em 'Python' iniciado por Stack, Maio 9, 2025.

  1. Stack

    Stack Membro Participativo

    The following code crashes and I don't understand why.

    from PySide6 import QtWidgets

    class MockParent(QtWidgets.QWidget):
    def __init__(self, /):
    try:
    super().__init__()
    except Exception as e:
    print(e)

    if __name__ == '__main__':
    parent = MockParent()
    app: QtWidgets.QApplication = QtWidgets.QApplication([])
    app.exec()


    The console gives me something like: Process finished with exit code -1073740791 (0xC0000409)

    I believe this kind of error happens in shared libraries. Ok, but why? What did I do wrong?

    My understanding of PySide6 documentation leads me to believe that I could pass "None" as arguments. I also set the window type, but the error still happens.

    Continue reading...

Compartilhe esta Página