forked from DeskTranslate/DeskTranslate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
splash_screen.py
32 lines (24 loc) · 1020 Bytes
/
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
from PyQt6.QtWidgets import QMainWindow, QLabel, QApplication
from PyQt6.QtGui import QMovie
from PyQt6.QtCore import Qt, QTimer
class SplashScreenWindow(QMainWindow):
def __init__(self, desk_translate_gui_window):
QMainWindow.__init__(self)
self.desk_translate_gui_window = desk_translate_gui_window
self.movie = QMovie("images/DeskTranslate.gif")
label = QLabel()
label.setMovie(self.movie)
self.setCentralWidget(label)
self.setWindowFlags(Qt.WindowType.FramelessWindowHint)
self.resize(500,500)
def showEvent(self, event):
self.movie.start()
QTimer.singleShot(2500, self.close)
def closeEvent(self, event):
self.desk_translate_gui_window.show()
if __name__=="__main__":
app = QApplication([])
main_window=QMainWindow() # To be replaced with the actual main window.
splash_screen_window = SplashScreenWindow(main_window)
splash_screen_window.show()
app.exec()