-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
executable file
·74 lines (68 loc) · 2.28 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from Pages.superadminHome import *
from Pages.superadmin.Doctor import *
from Pages.superadmin.Hospital import *
from Pages.superadmin.BloodBank import *
from Pages.superadmin.Events import *
import sys
from Pages.loginPage import *
import time
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("MDTouch")
self.loginpage = loginPage()
self.superadmin_home = superadminHome()
self.doctor_home = Doctor()
self.hospital_home = Hospital()
self.event_home = Events()
self.blood_home = BloodBank()
self.loginpage.setup(self)
# self.bloodbank = Ui_MainWindow()
# self.bloodbank.setupUi(self)
#self.showFullScreen()
self.shortcutQuit = QShortcut(QKeySequence(self.tr("Alt+C")), self)
self.shortcutQuit.activated.connect(self.close)
self.shortcutQuit.setEnabled(True)
self.showFullScreen()
#self.setFixedSize(1390,915)
self.show()
if __name__ == "__main__":
app = QApplication(sys.argv)
splash_pix = QPixmap('Images/splash_screen.jpg')
splash_pix = splash_pix.scaled(800,600, Qt.KeepAspectRatio, Qt.SmoothTransformation)
splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint)
splash.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint)
splash.setEnabled(False)
progressBar = QProgressBar(splash)
progressBar.setMaximum(100)
progressBar.setTextVisible(True)
progressBar.setAlignment(Qt.AlignCenter)
progressBar.setGeometry(20, splash_pix.height() - 50, splash_pix.width() - 40, 20)
css = """
QProgressBar{
border: 2px solid grey;
color:black;
border-radius: 5px;
text-align: center
}
QProgressBar::chunk {
background-color: green;
width: 10px;
}
"""
progressBar.setStyleSheet(css)
splash.show()
for i in range(1, 101):
progressBar.setValue(i)
t = time.time()
while time.time() < t + 0.0001:
app.processEvents()
time.sleep(1)
window = MainWindow()
splash.finish(window)
sys.exit(app.exec())