-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
55 lines (46 loc) · 1.46 KB
/
main.py
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
import cv2
import sys
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDialog, QApplication
from PyQt5.uic import loadUi
from page import Page
from save import Save
class Main(QDialog):
def __init__(self):
super(Main, self).__init__()
loadUi('ui/login.ui', self)
self.loginButton.clicked.connect(self.login)
self.signupButton.clicked.connect(self.create)
self.PW.setEchoMode(QtWidgets.QLineEdit.Password)
def login(self):
from face_rec import Face_Recognition
id = self.ID.text()
pw = self.PW.text()
print(f'{id} has logged in')
self.widget.addWidget(Face_Recognition())
self.widget.setCurrentIndex(self.widget.currentIndex() + 1)
#
# def save(self):
# cap.release()
# cv2.destroyAllWindows()
# self.take_photo.stop()
#
# widget.addWidget(self.save)
# widget.setCurrentIndex(widget.currentIndex() + 1)
def create(self):
from signup import Signup
self.widget.addWidget(Signup())
self.widget.setCurrentIndex(self.widget.currentIndex()+1)
# if __name__ == '__main__':
# main = Main()
# widget = Page()
# widget.addWidget(main)
# widget.show()
# # sys.exit(app.exec_())
app = QApplication(sys.argv)
widget = QtWidgets.QStackedWidget()
widget.setFixedHeight(1280)
widget.setFixedWidth(800)
widget.setWindowFlag(Qt.WindowStaysOnTopHint)
sys.exit(app.exec_())