pyqt / python-qt5

Unofficial PyQt5 via PyPI for Python 2.7 64-bit on Windows
GNU General Public License v3.0
280 stars 77 forks source link

how to run children UI? #46

Closed apepenkov closed 4 years ago

apepenkov commented 4 years ago

I have main ui, and want to run children ui on click in main ui. children: `class sessionGenerator(QtWidgets.QMainWindow, designTg.Ui_MainWindow2):

def __init__(self, parent):

    print(parent)

    super(sessionGenerator, self).__init__(parent)

    self.setupUi(self)

    self.showHelp.clicked.connect(self.showHelpFull)

    self.next_1.clicked.connect(self.nextOne)

    self.next_2.clicked.connect(self.nextTwo)

    self.next_3.clicked.connect(self.nextThree)

....................................................`

if I use `app2 = QtWidgets.QApplication(sys.argv)

        window2 = sessionGenerator()

        window2.show()

        app2.exec_()`

it appears on a second and throws 0xC0000005

just sessionGenerator runs great itself. But i can't figure out how to run it from another ui

apepenkov commented 4 years ago

Do not create second main application. only

window2 = sessionGenerator() window2.show()

This lines need to be before first app exec.

app.exec_()