P
P
potapovdmtriy2021-05-25 18:31:56
PyQt
potapovdmtriy, 2021-05-25 18:31:56

Pyqt5 how to open a second window on click???

For some reason the window closes.
Window 2:

class mywindow2(QtWidgets.QMainWindow):
    def __init__(self):
        super(mywindow2, self).__init__()
        self.ui = My_Window()
        self.ui.setupUi(self)


Method in first window class:
def show_w2(self):
        w2 = mywindow2()
        w2.show()

        sys.exit(app.exec())


Sorry, I study only Pyqt, there are many examples, but they do not work.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question