spacepaste

  1.  
  2. # System imports
  3. import sys
  4. from PyQt5 import QtWidgets
  5. from PyQt5.QtCore import pyqtSlot
  6. # Helpers and UI imports
  7. from ui.main import Ui_main as PrimerForm
  8. from ui.pages.loginPage import LoginPage
  9. from ui.pages.resetPwdPage import ResetPwdPage
  10. # Main app loop
  11. class Primer(QtWidgets.QWidget, PrimerForm):
  12. def __init__(self, parent=None):
  13. super(Primer, self).__init__(parent)
  14. self.setupUi(self)
  15. # Page Instances --------------------------------------------->
  16. # Login Page 0
  17. self.loginPage = LoginPage()
  18. self.loginPageContainer.addWidget(self.loginPage)
  19. # Reset Password Page 1
  20. self.resetPwdPage = ResetPwdPage()
  21. self.resetPwdPageContainer.addWidget(self.resetPwdPage)
  22. # End Page Instances ----------------------------------------->
  23. @pyqtSlot(int, name='login_success')
  24. def set_page_index(self, index):
  25. try:
  26. print(index)
  27. except Exception as e:
  28. print(e)
  29. if __name__ == "__main__":
  30. app = QtWidgets.QApplication(sys.argv)
  31. main = Primer()
  32. main.show()
  33. sys.exit(app.exec_())
  34.