-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsplash_screen.py
35 lines (28 loc) · 1.43 KB
/
splash_screen.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
from PyQt6.QtWidgets import QMainWindow
from PyQt6.QtCore import Qt, QTimer
from PyQt6 import uic
class SplashScreen(QMainWindow):
def __init__(self):
super().__init__()
uic.loadUi("gui/ui_Form_progress.ui", self)
self.setWindowFlag(Qt.WindowType.FramelessWindowHint)
self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
self.progressBar.setMaximum(100)
self.progressBar.setValue(0)
self.timer = QTimer()
self.timer.timeout.connect(self.update_progress)
self.timer.start(30)
# Cập nhật labelSubName sau mỗi khoảng thời gian
QTimer.singleShot(1000, lambda: self.labelSubName.setText("<strong>LOADING</strong><font style='color:white'> EXPLOITS</font>"))
QTimer.singleShot(1500, lambda: self.labelSubName.setText("<strong>LOADING</strong><font style='color:white'> DATABASE</font>"))
QTimer.singleShot(3000, lambda: self.labelSubName.setText("<strong>LOADING</strong><font style='color:white'> USER INTERFACE</font>"))
def update_progress(self):
current_value = self.progressBar.value()
if current_value < 100:
self.progressBar.setValue(current_value + 1)
else:
self.timer.stop()
self.close()
def finish(self, window):
self.timer.timeout.connect(lambda: window.show())
self.close() # Đóng splash screen sau khi hiển thị cửa sổ chính