Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
745 B
2
Indexable
Never
from PySide6.QtWidgets import (
    QApplication,
    QStackedLayout,
)
from PySide6.QtCore import Slot
from sys import exit
from os import system

system(
    "pyside6-uic main_window.ui > ui_main_window.py && pyside6-uic log_in.ui > ui_log_in.py"
)
from window_log_in import LogInWindow
from window_main import MainWindow


@Slot()
def load_main_window():
    layout.setCurrentWidget(main_window)


if __name__ == "__main__":
    app = QApplication([])

    layout = QStackedLayout()

    log_in_window = LogInWindow()
    layout.addWidget(log_in_window)

    main_window = MainWindow()
    layout.addWidget(main_window)
    layout.setCurrentWidget(log_in_window)

    log_in_window.logged_in.connect(load_main_window())

    exit(app.exec())