-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
executable file
·50 lines (35 loc) · 1.12 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
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import sys
import time
import signal
from PySide6.QtGui import *
from PySide6.QtCore import *
from PySide6.QtWidgets import *
from widgets.main_widget import MainWidget
signal.signal(signal.SIGINT, signal.SIG_DFL)
# import faulthandler
# faulthandler.enable()
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("PathCobbler 🥧")
self.control = MainWidget()
self.setCentralWidget(self.control)
logoPath = os.path.join(os.path.dirname(__file__), 'resources/images/logo.png')
self.setWindowIcon(QPixmap(logoPath))
splashScreen = QSplashScreen(QPixmap(logoPath))
splashScreen.show()
time.sleep(0.4)
def move_window_to_center(self):
center = QScreen.availableGeometry(QApplication.primaryScreen()).center()
geo = self.frameGeometry()
geo.moveCenter(center)
self.move(geo.topLeft())
if __name__ == '__main__':
app = QApplication()
mw = MainWindow()
mw.show()
mw.move_window_to_center()
sys.exit(app.exec())