-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUi_MainWindow.py
executable file
·214 lines (204 loc) · 10.2 KB
/
Ui_MainWindow.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from pathlib import Path
asset_path = Path('assets/')
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 480)
MainWindow.setAutoFillBackground(False)
MainWindow.setStyleSheet("")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setStyleSheet("")
self.centralwidget.setObjectName("centralwidget")
self.frontspeed = QtWidgets.QLCDNumber(self.centralwidget)
self.frontspeed.setGeometry(QtCore.QRect(330, 40, 291, 151))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.frontspeed.sizePolicy().hasHeightForWidth())
self.frontspeed.setSizePolicy(sizePolicy)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17, 128))
brush.setStyle(QtCore.Qt.NoBrush)
# palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17, 128))
brush.setStyle(QtCore.Qt.NoBrush)
# palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 108, 17, 128))
brush.setStyle(QtCore.Qt.NoBrush)
# palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.PlaceholderText, brush)
self.frontspeed.setPalette(palette)
self.frontspeed.setStyleSheet("QLCDNumber{\n"
" color: rgb(255,108,17) ;\n"
"}")
self.frontspeed.setFrameShape(QtWidgets.QFrame.NoFrame)
self.frontspeed.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
self.frontspeed.setProperty("intValue", 999)
self.frontspeed.setObjectName("frontspeed")
self.carspeed = QtWidgets.QLCDNumber(self.centralwidget)
self.carspeed.setGeometry(QtCore.QRect(50, 40, 291, 151))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.carspeed.sizePolicy().hasHeightForWidth())
self.carspeed.setSizePolicy(sizePolicy)
self.carspeed.setLayoutDirection(QtCore.Qt.LeftToRight)
self.carspeed.setStyleSheet("QLCDNumber{\n"
" color: rgb(255,108,17) ;\n"
"}")
self.carspeed.setFrameShape(QtWidgets.QFrame.NoFrame)
self.carspeed.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
self.carspeed.setProperty("intValue", 999)
self.carspeed.setObjectName("carspeed")
self.Background = QtWidgets.QLabel(self.centralwidget)
self.Background.setGeometry(QtCore.QRect(0, -80, 800, 640))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.Background.sizePolicy().hasHeightForWidth())
self.Background.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setPointSize(30)
self.Background.setFont(font)
self.Background.setStyleSheet("color: rgb(45, 226, 230);")
self.Background.setText("")
self.Background.setPixmap(QtGui.QPixmap(str(asset_path / "flashretrobackground.jpg")))
self.Background.setAlignment(QtCore.Qt.AlignCenter)
self.Background.setObjectName("Background")
self.rpm = QtWidgets.QLCDNumber(self.centralwidget)
self.rpm.setGeometry(QtCore.QRect(120, 370, 111, 21))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(2)
sizePolicy.setVerticalStretch(2)
sizePolicy.setHeightForWidth(self.rpm.sizePolicy().hasHeightForWidth())
self.rpm.setSizePolicy(sizePolicy)
self.rpm.setStyleSheet("QLCDNumber{\n"
" color: rgb(255,108,17) ;\n"
"}")
self.rpm.setFrameShape(QtWidgets.QFrame.NoFrame)
self.rpm.setDigitCount(4)
self.rpm.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
self.rpm.setProperty("intValue", 999)
self.rpm.setObjectName("rpm")
self.distance = QtWidgets.QLCDNumber(self.centralwidget)
self.distance.setGeometry(QtCore.QRect(550, 370, 121, 21))
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(3)
sizePolicy.setVerticalStretch(3)
sizePolicy.setHeightForWidth(self.distance.sizePolicy().hasHeightForWidth())
self.distance.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setPointSize(8)
self.distance.setFont(font)
self.distance.setStyleSheet("QLCDNumber{\n"
" color: rgb(255,108,17) ;\n"
"}")
self.distance.setFrameShape(QtWidgets.QFrame.NoFrame)
self.distance.setSmallDecimalPoint(True)
self.distance.setDigitCount(5)
self.distance.setMode(QtWidgets.QLCDNumber.Dec)
self.distance.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
self.distance.setProperty("value", 999)
# self.distance.setProperty("intValue", 23)
self.distance.setObjectName("distance")
self.rpm_meter = QtWidgets.QLabel(self.centralwidget)
self.rpm_meter.setGeometry(QtCore.QRect(0, -80, 800, 640))
self.rpm_meter.setAutoFillBackground(False)
self.rpm_meter.setStyleSheet("")
self.rpm_meter.setText("")
self.rpm_meter.setTextFormat(QtCore.Qt.RichText)
self.rpm_meter.setPixmap(QtGui.QPixmap(""))
self.rpm_meter.setScaledContents(False)
self.rpm_meter.setOpenExternalLinks(False)
self.rpm_meter.setObjectName("rpm_meter")
self.dist_meter = QtWidgets.QLabel(self.centralwidget)
self.dist_meter.setGeometry(QtCore.QRect(0, -80, 800, 640))
self.dist_meter.setAutoFillBackground(False)
self.dist_meter.setStyleSheet("")
self.dist_meter.setText("")
self.dist_meter.setTextFormat(QtCore.Qt.RichText)
self.dist_meter.setPixmap(QtGui.QPixmap(""))
self.dist_meter.setScaledContents(False)
self.dist_meter.setOpenExternalLinks(False)
self.dist_meter.setObjectName("dist_meter")
self.frontcar = QtWidgets.QLabel(self.centralwidget)
self.frontcar.setGeometry(QtCore.QRect(0, -80, 800, 640))
self.frontcar.setText("")
self.frontcar.setPixmap(QtGui.QPixmap(str(asset_path / "frontcar.png")))
self.frontcar.setObjectName("frontcar")
self.okaystat = QtWidgets.QLabel(self.centralwidget)
self.okaystat.setGeometry(QtCore.QRect(0, -80, 800, 640))
self.okaystat.setText("")
self.okaystat.setPixmap(QtGui.QPixmap(str(asset_path / "ok.png")))
self.okaystat.setObjectName("okaystat")
self.Background.raise_()
self.dist_meter.raise_()
self.rpm_meter.raise_()
self.frontspeed.raise_()
self.rpm.raise_()
self.distance.raise_()
self.carspeed.raise_()
self.frontcar.raise_()
self.okaystat.raise_()
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(770, 0, 25, 25))
font = QtGui.QFont()
font.setStrikeOut(True)
font.setKerning(True)
self.pushButton.setFont(font)
self.pushButton.setText("")
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(str(asset_path / "exit.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton.setIcon(icon)
self.pushButton.setShortcut("")
self.pushButton.setAutoDefault(False)
self.pushButton.setFlat(True)
self.pushButton.setObjectName("pushButton")
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())