How should I start a screen?
-
How do I start a login screen and sequentially a main screen (after data validation) ? I am a beginner and saw that it is not feasible to have two QApplication screens on the same system. However, as I use qtDesigner to develop my GUIs the code that runs my screens is automatically generated:
if __name__ == '__main__': import sys app = QtWidgets.QApplication.instance() MainWindow = QtWidgets.QMainWindow() ui = TelaLogin() ui.setupUi(MainWindow) MainWindow.show() sys.exit(app.exec_())
How do I stop my login screen from being QApplication so that the main screen can run?
-
Hi,
You should do it in two steps. First manage the login using a dialog and only if successful continue with the MainWindow.
-
Hi,
You should do it in two steps. First manage the login using a dialog and only if successful continue with the MainWindow.
@SGaist Now my login screen is a QDialog and my main screen is a QMainWindow. I want to manage these screens through another file (main.py), but I don't know how to start these screens in this file.
The code generated by qtDesigner generated this screen execution code:
import sys app = QtWidgets.QApplication(sys.argv) Dialog = QtWidgets.QDialog() ui = Ui_Dialog() ui.setupUi(Dialog) Dialog.show() sys.exit(app.exec_())