-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialog.py
268 lines (261 loc) · 12.9 KB
/
dialog.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'dialog.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(843, 598)
MainWindow.setLayoutDirection(QtCore.Qt.LeftToRight)
MainWindow.setAutoFillBackground(False)
MainWindow.setStyleSheet("")
self.centralwidget = QtWidgets.QWidget(MainWindow)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
self.centralwidget.setSizePolicy(sizePolicy)
self.centralwidget.setAutoFillBackground(False)
self.centralwidget.setStyleSheet("")
self.centralwidget.setObjectName("centralwidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName("horizontalLayout")
self.canvasWidget = CanvasWidget(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.canvasWidget.sizePolicy().hasHeightForWidth())
self.canvasWidget.setSizePolicy(sizePolicy)
self.canvasWidget.setMinimumSize(QtCore.QSize(560, 560))
self.canvasWidget.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.canvasWidget.setMouseTracking(False)
self.canvasWidget.setStyleSheet("")
self.canvasWidget.setObjectName("canvasWidget")
self.horizontalLayout.addWidget(self.canvasWidget)
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setContentsMargins(0, 10, 5, 10)
self.gridLayout.setObjectName("gridLayout")
self.label_1 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_1.setFont(font)
self.label_1.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_1.setObjectName("label_1")
self.gridLayout.addWidget(self.label_1, 1, 1, 1, 1)
self.label_6 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_6.setFont(font)
self.label_6.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 6, 1, 1, 1)
self.label_2 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_2.setFont(font)
self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 2, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_3.setFont(font)
self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 3, 1, 1, 1)
self.label_5 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_5.setFont(font)
self.label_5.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 5, 1, 1, 1)
self.label_9 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_9.setFont(font)
self.label_9.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_9.setObjectName("label_9")
self.gridLayout.addWidget(self.label_9, 9, 1, 1, 1)
self.label_8 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_8.setFont(font)
self.label_8.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_8.setObjectName("label_8")
self.gridLayout.addWidget(self.label_8, 8, 1, 1, 1)
self.label_7 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_7.setFont(font)
self.label_7.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_7.setObjectName("label_7")
self.gridLayout.addWidget(self.label_7, 7, 1, 1, 1)
self.label_4 = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_4.setFont(font)
self.label_4.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 4, 1, 1, 1)
self.label_9_text = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_9_text.setFont(font)
self.label_9_text.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_9_text.setObjectName("label_9_text")
self.gridLayout.addWidget(self.label_9_text, 9, 0, 1, 1)
self.label_8_text = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_8_text.setFont(font)
self.label_8_text.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_8_text.setObjectName("label_8_text")
self.gridLayout.addWidget(self.label_8_text, 8, 0, 1, 1)
self.label_7_text = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_7_text.setFont(font)
self.label_7_text.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_7_text.setObjectName("label_7_text")
self.gridLayout.addWidget(self.label_7_text, 7, 0, 1, 1)
self.label_5_text = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_5_text.setFont(font)
self.label_5_text.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_5_text.setObjectName("label_5_text")
self.gridLayout.addWidget(self.label_5_text, 5, 0, 1, 1)
self.label_6_text = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_6_text.setFont(font)
self.label_6_text.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_6_text.setObjectName("label_6_text")
self.gridLayout.addWidget(self.label_6_text, 6, 0, 1, 1)
self.label_4_text = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_4_text.setFont(font)
self.label_4_text.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_4_text.setObjectName("label_4_text")
self.gridLayout.addWidget(self.label_4_text, 4, 0, 1, 1)
self.label_1_text = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_1_text.setFont(font)
self.label_1_text.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_1_text.setIndent(0)
self.label_1_text.setObjectName("label_1_text")
self.gridLayout.addWidget(self.label_1_text, 1, 0, 1, 1)
self.label_3_text = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_3_text.setFont(font)
self.label_3_text.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_3_text.setObjectName("label_3_text")
self.gridLayout.addWidget(self.label_3_text, 3, 0, 1, 1)
self.label_2_text = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_2_text.setFont(font)
self.label_2_text.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_2_text.setObjectName("label_2_text")
self.gridLayout.addWidget(self.label_2_text, 2, 0, 1, 1)
self.label_0_text = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_0_text.setFont(font)
self.label_0_text.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_0_text.setIndent(0)
self.label_0_text.setObjectName("label_0_text")
self.gridLayout.addWidget(self.label_0_text, 0, 0, 1, 1)
self.label_0 = QtWidgets.QLabel(self.centralwidget)
self.label_0.setMinimumSize(QtCore.QSize(130, 0))
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.label_0.setFont(font)
self.label_0.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_0.setObjectName("label_0")
self.gridLayout.addWidget(self.label_0, 0, 1, 1, 1)
self.clearCanvas = QtWidgets.QPushButton(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(20)
font.setBold(True)
font.setWeight(75)
self.clearCanvas.setFont(font)
self.clearCanvas.setObjectName("clearCanvas")
self.gridLayout.addWidget(self.clearCanvas, 10, 0, 1, 2)
self.horizontalLayout.addLayout(self.gridLayout)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "Digit Recognition Canvas"))
self.label_1.setText(_translate("MainWindow", "0.00%"))
self.label_6.setText(_translate("MainWindow", "0.00%"))
self.label_2.setText(_translate("MainWindow", "0.00%"))
self.label_3.setText(_translate("MainWindow", "0.00%"))
self.label_5.setText(_translate("MainWindow", "0.00%"))
self.label_9.setText(_translate("MainWindow", "0.00%"))
self.label_8.setText(_translate("MainWindow", "0.00%"))
self.label_7.setText(_translate("MainWindow", "0.00%"))
self.label_4.setText(_translate("MainWindow", "0.00%"))
self.label_9_text.setText(_translate("MainWindow", "Nine: "))
self.label_8_text.setText(_translate("MainWindow", "Eight: "))
self.label_7_text.setText(_translate("MainWindow", "Seven: "))
self.label_5_text.setText(_translate("MainWindow", "Five: "))
self.label_6_text.setText(_translate("MainWindow", "Six: "))
self.label_4_text.setText(_translate("MainWindow", "Four: "))
self.label_1_text.setText(_translate("MainWindow", "One: "))
self.label_3_text.setText(_translate("MainWindow", "Three: "))
self.label_2_text.setText(_translate("MainWindow", "Two: "))
self.label_0_text.setText(_translate("MainWindow", "Zero: "))
self.label_0.setText(_translate("MainWindow", "0.00%"))
self.clearCanvas.setText(_translate("MainWindow", "Clear Canvas"))
from canvaswidget import CanvasWidget