-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathGUI.py
More file actions
387 lines (378 loc) · 19.1 KB
/
GUI.py
File metadata and controls
387 lines (378 loc) · 19.1 KB
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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'GUI.ui'
# Created by: PyQt5 UI code generator 5.9.2
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(681, 400)
Form.setMinimumSize(QtCore.QSize(681, 400))
Form.setStyleSheet("background-color: rgb(0, 0, 255);")
self.pantalla = QtWidgets.QTabWidget(Form)
self.pantalla.setGeometry(QtCore.QRect(0, 0, 681, 400))
self.pantalla.setMinimumSize(QtCore.QSize(681, 400))
self.pantalla.setStyleSheet("background-color: rgb(255, 255, 255);\n"
"color: rgb(0, 0, 0);")
self.pantalla.setObjectName("pantalla")
self.tab_5 = QtWidgets.QWidget()
self.tab_5.setObjectName("tab_5")
self.bt_refrescar = QtWidgets.QPushButton(self.tab_5)
self.bt_refrescar.setGeometry(QtCore.QRect(550, 320, 75, 23))
self.bt_refrescar.setStyleSheet("background-color: rgb(85, 0, 255);\n"
"color: rgb(255, 255, 255);\n"
"font: 75 10pt \"MS Shell Dlg 2\";")
self.bt_refrescar.setObjectName("bt_refrescar")
self.tabla_productos = QtWidgets.QTableWidget(self.tab_5)
self.tabla_productos.setGeometry(QtCore.QRect(30, 60, 511, 281))
self.tabla_productos.setRowCount(0)
self.tabla_productos.setColumnCount(5)
self.tabla_productos.setObjectName("tabla_productos")
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(255, 0, 191))
self.tabla_productos.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(85, 255, 127))
self.tabla_productos.setHorizontalHeaderItem(1, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(255, 248, 53))
self.tabla_productos.setHorizontalHeaderItem(2, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(0, 170, 127))
self.tabla_productos.setHorizontalHeaderItem(3, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(255, 170, 0))
self.tabla_productos.setHorizontalHeaderItem(4, item)
self.pantalla.addTab(self.tab_5, "")
self.tab = QtWidgets.QWidget()
self.tab.setObjectName("tab")
self.bt_buscar = QtWidgets.QPushButton(self.tab)
self.bt_buscar.setGeometry(QtCore.QRect(550, 330, 75, 23))
self.bt_buscar.setStyleSheet("background-color: rgb(85, 0, 255);\n"
"color: rgb(255, 255, 255);\n"
"font: 75 10pt \"MS Shell Dlg 2\";")
self.bt_buscar.setObjectName("bt_buscar")
self.codigoB = QtWidgets.QLineEdit(self.tab)
self.codigoB.setGeometry(QtCore.QRect(72, 51, 101, 20))
self.codigoB.setText("")
self.codigoB.setObjectName("codigoB")
self.label = QtWidgets.QLabel(self.tab)
self.label.setGeometry(QtCore.QRect(21, 51, 45, 16))
self.label.setObjectName("label")
self.tabla_buscar = QtWidgets.QTableWidget(self.tab)
self.tabla_buscar.setGeometry(QtCore.QRect(30, 90, 511, 261))
self.tabla_buscar.setRowCount(0)
self.tabla_buscar.setColumnCount(5)
self.tabla_buscar.setObjectName("tabla_buscar")
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(255, 0, 191))
self.tabla_buscar.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(85, 255, 127))
self.tabla_buscar.setHorizontalHeaderItem(1, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(255, 248, 53))
self.tabla_buscar.setHorizontalHeaderItem(2, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(0, 170, 127))
self.tabla_buscar.setHorizontalHeaderItem(3, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(255, 170, 0))
self.tabla_buscar.setHorizontalHeaderItem(4, item)
self.pantalla.addTab(self.tab, "")
self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2")
self.bt_agregar = QtWidgets.QPushButton(self.tab_2)
self.bt_agregar.setGeometry(QtCore.QRect(420, 260, 75, 23))
self.bt_agregar.setStyleSheet("background-color: rgb(85, 0, 255);\n"
"color: rgb(255, 255, 255);\n"
"font: 75 10pt \"MS Shell Dlg 2\";")
self.bt_agregar.setObjectName("bt_agregar")
self.layoutWidget = QtWidgets.QWidget(self.tab_2)
self.layoutWidget.setGeometry(QtCore.QRect(170, 70, 231, 211))
self.layoutWidget.setObjectName("layoutWidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.label_2 = QtWidgets.QLabel(self.layoutWidget)
self.label_2.setObjectName("label_2")
self.verticalLayout_2.addWidget(self.label_2)
self.label_3 = QtWidgets.QLabel(self.layoutWidget)
self.label_3.setObjectName("label_3")
self.verticalLayout_2.addWidget(self.label_3)
self.label_4 = QtWidgets.QLabel(self.layoutWidget)
self.label_4.setObjectName("label_4")
self.verticalLayout_2.addWidget(self.label_4)
self.label_5 = QtWidgets.QLabel(self.layoutWidget)
self.label_5.setObjectName("label_5")
self.verticalLayout_2.addWidget(self.label_5)
self.label_6 = QtWidgets.QLabel(self.layoutWidget)
self.label_6.setObjectName("label_6")
self.verticalLayout_2.addWidget(self.label_6)
self.horizontalLayout.addLayout(self.verticalLayout_2)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.codigoA = QtWidgets.QLineEdit(self.layoutWidget)
self.codigoA.setObjectName("codigoA")
self.verticalLayout.addWidget(self.codigoA)
self.nombreA = QtWidgets.QLineEdit(self.layoutWidget)
self.nombreA.setObjectName("nombreA")
self.verticalLayout.addWidget(self.nombreA)
self.modeloA = QtWidgets.QLineEdit(self.layoutWidget)
self.modeloA.setObjectName("modeloA")
self.verticalLayout.addWidget(self.modeloA)
self.precioA = QtWidgets.QLineEdit(self.layoutWidget)
self.precioA.setObjectName("precioA")
self.verticalLayout.addWidget(self.precioA)
self.cantidadA = QtWidgets.QLineEdit(self.layoutWidget)
self.cantidadA.setObjectName("cantidadA")
self.verticalLayout.addWidget(self.cantidadA)
self.horizontalLayout.addLayout(self.verticalLayout)
self.pantalla.addTab(self.tab_2, "")
self.tab_3 = QtWidgets.QWidget()
self.tab_3.setObjectName("tab_3")
self.bt_actualizar = QtWidgets.QPushButton(self.tab_3)
self.bt_actualizar.setGeometry(QtCore.QRect(530, 280, 91, 21))
self.bt_actualizar.setStyleSheet("background-color: rgb(85, 0, 255);\n"
"color: rgb(255, 255, 255);\n"
"font: 75 10pt \"MS Shell Dlg 2\";")
self.bt_actualizar.setObjectName("bt_actualizar")
self.layoutWidget1 = QtWidgets.QWidget(self.tab_3)
self.layoutWidget1.setGeometry(QtCore.QRect(270, 80, 251, 221))
self.layoutWidget1.setObjectName("layoutWidget1")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.layoutWidget1)
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.verticalLayout_4 = QtWidgets.QVBoxLayout()
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.label_7 = QtWidgets.QLabel(self.layoutWidget1)
self.label_7.setObjectName("label_7")
self.verticalLayout_4.addWidget(self.label_7)
self.label_8 = QtWidgets.QLabel(self.layoutWidget1)
self.label_8.setObjectName("label_8")
self.verticalLayout_4.addWidget(self.label_8)
self.label_9 = QtWidgets.QLabel(self.layoutWidget1)
self.label_9.setObjectName("label_9")
self.verticalLayout_4.addWidget(self.label_9)
self.label_10 = QtWidgets.QLabel(self.layoutWidget1)
self.label_10.setObjectName("label_10")
self.verticalLayout_4.addWidget(self.label_10)
self.label_11 = QtWidgets.QLabel(self.layoutWidget1)
self.label_11.setObjectName("label_11")
self.verticalLayout_4.addWidget(self.label_11)
self.horizontalLayout_2.addLayout(self.verticalLayout_4)
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.codigo_actualizar = QtWidgets.QLineEdit(self.layoutWidget1)
self.codigo_actualizar.setObjectName("codigo_actualizar")
self.verticalLayout_3.addWidget(self.codigo_actualizar)
self.nombre_actualizar = QtWidgets.QLineEdit(self.layoutWidget1)
self.nombre_actualizar.setObjectName("nombre_actualizar")
self.verticalLayout_3.addWidget(self.nombre_actualizar)
self.modelo_actualizar = QtWidgets.QLineEdit(self.layoutWidget1)
self.modelo_actualizar.setObjectName("modelo_actualizar")
self.verticalLayout_3.addWidget(self.modelo_actualizar)
self.precio_actualizar = QtWidgets.QLineEdit(self.layoutWidget1)
self.precio_actualizar.setObjectName("precio_actualizar")
self.verticalLayout_3.addWidget(self.precio_actualizar)
self.cantidad_actualizar = QtWidgets.QLineEdit(self.layoutWidget1)
self.cantidad_actualizar.setObjectName("cantidad_actualizar")
self.verticalLayout_3.addWidget(self.cantidad_actualizar)
self.horizontalLayout_2.addLayout(self.verticalLayout_3)
self.id_producto = QtWidgets.QLineEdit(self.tab_3)
self.id_producto.setGeometry(QtCore.QRect(30, 120, 180, 20))
self.id_producto.setObjectName("id_producto")
self.label_13 = QtWidgets.QLabel(self.tab_3)
self.label_13.setGeometry(QtCore.QRect(40, 80, 191, 39))
self.label_13.setObjectName("label_13")
self.id_buscar = QtWidgets.QPushButton(self.tab_3)
self.id_buscar.setGeometry(QtCore.QRect(70, 150, 75, 23))
self.id_buscar.setStyleSheet("background-color: rgb(255, 255, 255);")
self.id_buscar.setObjectName("id_buscar")
self.pantalla.addTab(self.tab_3, "")
self.tab_4 = QtWidgets.QWidget()
self.tab_4.setObjectName("tab_4")
self.codigo_borrar = QtWidgets.QLineEdit(self.tab_4)
self.codigo_borrar.setGeometry(QtCore.QRect(91, 50, 101, 20))
self.codigo_borrar.setText("")
self.codigo_borrar.setObjectName("codigo_borrar")
self.label_12 = QtWidgets.QLabel(self.tab_4)
self.label_12.setGeometry(QtCore.QRect(40, 50, 45, 16))
self.label_12.setObjectName("label_12")
self.borrar_ok = QtWidgets.QPushButton(self.tab_4)
self.borrar_ok.setGeometry(QtCore.QRect(200, 50, 91, 23))
self.borrar_ok.setStyleSheet("background-color: rgb(255, 0, 127);")
self.borrar_ok.setObjectName("borrar_ok")
self.bt_borrar = QtWidgets.QPushButton(self.tab_4)
self.bt_borrar.setGeometry(QtCore.QRect(560, 290, 75, 23))
self.bt_borrar.setStyleSheet("background-color: rgb(85, 0, 255);\n"
"color: rgb(255, 255, 255);\n"
"font: 75 10pt \"MS Shell Dlg 2\";")
self.bt_borrar.setObjectName("bt_borrar")
self.tabla_borrar = QtWidgets.QTableWidget(self.tab_4)
self.tabla_borrar.setGeometry(QtCore.QRect(30, 80, 511, 231))
self.tabla_borrar.setRowCount(0)
self.tabla_borrar.setColumnCount(5)
self.tabla_borrar.setObjectName("tabla_borrar")
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(255, 0, 191))
self.tabla_borrar.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(85, 255, 127))
self.tabla_borrar.setHorizontalHeaderItem(1, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(255, 248, 53))
self.tabla_borrar.setHorizontalHeaderItem(2, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(0, 170, 127))
self.tabla_borrar.setHorizontalHeaderItem(3, item)
item = QtWidgets.QTableWidgetItem()
item.setTextAlignment(QtCore.Qt.AlignCenter)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
item.setFont(font)
item.setBackground(QtGui.QColor(255, 170, 0))
self.tabla_borrar.setHorizontalHeaderItem(4, item)
self.pantalla.addTab(self.tab_4, "")
self.retranslateUi(Form)
self.pantalla.setCurrentIndex(3)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "REGISTRO DE PRODUCTOS"))
self.bt_refrescar.setText(_translate("Form", "REFRESCAR"))
item = self.tabla_productos.horizontalHeaderItem(0)
item.setText(_translate("Form", "Codigo"))
item = self.tabla_productos.horizontalHeaderItem(1)
item.setText(_translate("Form", "Nombre"))
item = self.tabla_productos.horizontalHeaderItem(2)
item.setText(_translate("Form", "Modelo"))
item = self.tabla_productos.horizontalHeaderItem(3)
item.setText(_translate("Form", "Precio"))
item = self.tabla_productos.horizontalHeaderItem(4)
item.setText(_translate("Form", "Cantidad"))
self.pantalla.setTabText(self.pantalla.indexOf(self.tab_5), _translate("Form", "PRODUCTOS"))
self.bt_buscar.setText(_translate("Form", "BUSCAR"))
self.label.setText(_translate("Form", "CODIGO:"))
item = self.tabla_buscar.horizontalHeaderItem(0)
item.setText(_translate("Form", "Codigo"))
item = self.tabla_buscar.horizontalHeaderItem(1)
item.setText(_translate("Form", "Nombre"))
item = self.tabla_buscar.horizontalHeaderItem(2)
item.setText(_translate("Form", "Modelo"))
item = self.tabla_buscar.horizontalHeaderItem(3)
item.setText(_translate("Form", "Precio"))
item = self.tabla_buscar.horizontalHeaderItem(4)
item.setText(_translate("Form", "Cantidad"))
self.pantalla.setTabText(self.pantalla.indexOf(self.tab), _translate("Form", "BUSCAR PRODUCTO"))
self.bt_agregar.setText(_translate("Form", "AGREGAR"))
self.label_2.setText(_translate("Form", "CODIGO:"))
self.label_3.setText(_translate("Form", "NOMBRE:"))
self.label_4.setText(_translate("Form", "MODELO:"))
self.label_5.setText(_translate("Form", "PRECIO: "))
self.label_6.setText(_translate("Form", "CANTIDAD: "))
self.pantalla.setTabText(self.pantalla.indexOf(self.tab_2), _translate("Form", "AGREGAR NUEVOS PRODUCTOS"))
self.bt_actualizar.setText(_translate("Form", "ACTUALIZAR"))
self.label_7.setText(_translate("Form", "CODIGO:"))
self.label_8.setText(_translate("Form", "NOMBRE:"))
self.label_9.setText(_translate("Form", "MODELO:"))
self.label_10.setText(_translate("Form", "PRECIO: "))
self.label_11.setText(_translate("Form", "CANTIDAD: "))
self.label_13.setText(_translate("Form", "INGRESE EL ID DEL PRODUCTO"))
self.id_buscar.setText(_translate("Form", "BUSCAR"))
self.pantalla.setTabText(self.pantalla.indexOf(self.tab_3), _translate("Form", "ACTUALIZAR PRODUCTOS"))
self.label_12.setText(_translate("Form", "CODIGO:"))
self.borrar_ok.setText(_translate("Form", "OK"))
self.bt_borrar.setText(_translate("Form", "BORRAR"))
item = self.tabla_borrar.horizontalHeaderItem(0)
item.setText(_translate("Form", "Codigo"))
item = self.tabla_borrar.horizontalHeaderItem(1)
item.setText(_translate("Form", "Nombre"))
item = self.tabla_borrar.horizontalHeaderItem(2)
item.setText(_translate("Form", "Modelo"))
item = self.tabla_borrar.horizontalHeaderItem(3)
item.setText(_translate("Form", "Precio"))
item = self.tabla_borrar.horizontalHeaderItem(4)
item.setText(_translate("Form", "Cantidad"))
self.pantalla.setTabText(self.pantalla.indexOf(self.tab_4), _translate("Form", "BORRAR PRODUCTOS"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Form = QtWidgets.QWidget()
ui = Ui_Form()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec_())