R
R
Roman prV2020-03-20 21:17:35
Python
Roman prV, 2020-03-20 21:17:35

How to open a new window on button click in python Qt5?

I can’t find anywhere, accessible to my understanding, a way, like in python qt5, when you click on a button, open a new window and at the same time keep the old one open. I defined the button click event, and then how?

class MainMenues(QtWidgets.QMainWindow):
def __init__(self):
super(MainMenues, self).__init__()
self.ui = MainMenu()
self.ui.setupUi(self)
self.ui.videosettings.clicked.connect(self .viclick) #click detection
def viclick(self):
print("(XD)") #a new window should open here

app = QtWidgets.QApplication([])
application = MainMenues()
application.show()
sys.exit(app .exec())

If it helps, here are the sourceshttps://yadi.sk/d/-heHbKzauKem7A

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