-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathBrepCAD.py
58 lines (53 loc) · 1.78 KB
/
BrepCAD.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
# -*- coding: utf-8 -*-
from PyQt5 import QtWidgets,QtGui,QtCore
from PyQt5.QtWidgets import QApplication
from Win64.Gui import MainGui
import sys
from Win64.module import ShowGui
class Mywindown(QtWidgets.QMainWindow, ShowGui.Ui_MainWindow,MainGui.Ui_MainWindow):
def __init__(self, parent=None):
super(Mywindown, self).__init__(parent)
# 3D显示设置
self.TittleBar.windownre_pushButton.Add_Action(action_1=self.showMaximized,action_2=self.showNormal)
self.TittleBar.winwownminimizing_pushButton.Add_Action(action_1=self.showMinimized)
self.TittleBar.exit_pushButton.Add_Action(action_1=sys.exit)
self.setWindowTitle("BrepCAD")
def centerOnScreen(self):
'''Centers the window on the screen.'''
resolution = QtWidgets.QApplication.desktop().screenGeometry()
x = (resolution.width() - self.frameSize().width()) / 2
y = (resolution.height() - self.frameSize().height()) / 2
self.move(x, y)
def changeEvent(self, e):
if e.type() == QtCore.QEvent.WindowStateChange:
if self.isMinimized():
#print("窗口最小化")
pass
elif self.isMaximized():
pass
elif self.isFullScreen():
#print("全屏显示")
pass
elif self.isActiveWindow():
#print("活动窗口")
pass
if __name__ == '__main__':
# checks if QApplication already exists
#QApplication.setStyle(QStyleFactory.create('Fusion'))
QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
app = QtWidgets.QApplication.instance()
if not app:
app = QtWidgets.QApplication(sys.argv)
# 启动界面
try:
splash = QtWidgets.QSplashScreen(QtGui.QPixmap("./Images/Pic/setup_pic.png")) # 启动图片设置
splash.show()
splash.showMessage("软件启动中......")
except:
pass
# --------------------
win = Mywindown()
win.show()
splash.finish(win)
win.raise_()
app.exec_()