title: PyQt5: How to open a new Dialog with button click
body: <pre><code>import sys
  from PyQt5.QtCore import pyqtSlot
  from PyQt5.QtWidgets import QApplication, QDialog
  from PyQt5.uic import loadUi
  
  class LoginPage(QDialog):
      def __init__(self):
          super(LoginPage, self).__init__()
          loadUi('LoginPage.ui', self)
  
  class RegisterPage(QDialog):
      def __init__(self):
          super(RegisterPage, self).__init__()
          loadUi('RegisterPage.ui', self)
  
  
  class HomePage(QDialog):
      def __init__(self):
          super(HomePage, self).__init__()
          loadUi('HomePage.ui', self)
          #self.btnLoginPage.clicked.connect(self.executeLoginPage)
          #self.btnRegisterPage.clicked.connect(self.executeRegisterPage)
  
  app = QApplication(sys.argv)
  widget = HomePage()
  widget.show()
  sys.exit(app.exec_())
  </code></pre>
  
  <p>I have made 3 .ui files using <strong>qt designer</strong>.</p>
  
  <ol>
  <li>HomePage.ui</li>
  <li>LoginPage.ui</li>
  <li>RegisterPage.ui</li>
  </ol>
  
  <p>With this code, I can display the HomePage, which has 2 buttons. When I press a button, LoginPage or RegisterPage should open.</p>
  
  <p>This is where the problem comes,  I do not know how do I display the other 2 Dialogs. Any help will be appreciated</p>