forked from ChibaniMohamed/Polaris
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
45 lines (40 loc) · 1.3 KB
/
main.py
File metadata and controls
45 lines (40 loc) · 1.3 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
import sys,time
from splash import *
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMainWindow,QApplication,QGraphicsDropShadowEffect
counter = 0
class MainWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
from gui import Ui_MainWindow
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
class SplashScreen(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.ui_ = Ui_self()
self.ui_.setupUi_(self)
self.setWindowFlag(QtCore.Qt.FramelessWindowHint)
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
self.timer = QtCore.QTimer()
self.timer.timeout.connect(self.progress)
self.timer.start(35)
self.show()
self.center()
def center(self):
geo_frame = self.frameGeometry()
cp = QtWidgets.QDesktopWidget().availableGeometry().center()
geo_frame.moveCenter(cp)
self.move(geo_frame.topLeft())
def progress(self):
global counter
if counter > 200:
self.timer.stop()
self.main = MainWindow()
self.main.show()
self.close()
counter += 1
if __name__ == '__main__':
app = QApplication(sys.argv)
window = SplashScreen()
sys.exit(app.exec_())