-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.py
More file actions
55 lines (41 loc) · 1.47 KB
/
mainwindow.py
File metadata and controls
55 lines (41 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'maindisplay.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
import sys, datetime
from PyQt5.QtWidgets import *
from PyQt5 import uic
from PyQt5 import QtCore
from GuestUI import Form
from Host import Host
from PyQt5.QtGui import QFont
from PyQt5.QtCore import QDateTime, QTimer
from PyQt5.QtCore import QTimer,Qt, QTime
import time
form_main = uic.loadUiType("maindisplay.ui")[0] #ui파일 가져오기
class MainWindow(QMainWindow,QWidget, form_main): #MainWindow 클래스 정의
def __init__(self):
super().__init__()
self.initUI()
self.show()
def initUI(self):
self.setupUi(self)
self.btnGuest.clicked.connect(self.move_to_guest)
self.btnHost.clicked.connect(self.move_to_host)
def move_to_guest(self):
self.close()#hide main window
self.second = Form()# Form클래스 받아옴
self.second.exec() #guest창 닫을 때까지 대기
self.show()# guest창 닫으면서 메인화면으로 이동
def move_to_host(self):
self.close()
self.third = Host()
self.third.exec()
self.show()
if __name__ == "__main__":
app = QApplication(sys.argv)
win = MainWindow()
sys.exit(app.exec_())