Answer the question
In order to leave comments, you need to log in
How to implement correct transition between Dialog and MainWindow PyQt5?
In general, the code is below. process in the dispatcher, who will tell you how to implement the transition in a more humane way?
(code to understand how it works..)
class Win2(QtWidgets.QDialog):
def __init__(self, parent = None):
super(BkTo, self).__init__(parent)
self.bk = Ui_BackTo()
self.bk.setupUi(self)
class Win1(QtWidgets.QMainWindow):
def __init__(self, parent=None):
QtWidgets.QWidget.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.Enter.clicked.connect(self.enterOpen)
def enterOpen(self):
dial = Win2(self)
dial.exec_()
dial.show()
if __name__ == "__main__":
app = QtWidgets.QApplication([])
application = MyWin()
application.show()
sys.exit(app.exec())
Answer the question
In order to leave comments, you need to log in
class Win2(QtWidgets.QDialog):
def __init__(self, parent = None):
super(BkTo, self).__init__(parent)
dial.exec_()
dial.show()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question