|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | + |
| 3 | +# Form implementation generated from reading ui file 'calculadora.ui' |
| 4 | +# |
| 5 | +# Created by: PyQt5 UI code generator 5.9.2 |
| 6 | +# |
| 7 | +# WARNING! All changes made in this file will be lost! |
| 8 | + |
| 9 | +from PyQt5 import QtCore, QtGui, QtWidgets |
| 10 | + |
| 11 | +class Ui_Form(object): |
| 12 | + def setupUi(self, Form): |
| 13 | + Form.setObjectName("Form") |
| 14 | + Form.resize(342, 311) |
| 15 | + icon = QtGui.QIcon() |
| 16 | + icon.addPixmap(QtGui.QPixmap("icono.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
| 17 | + Form.setWindowIcon(icon) |
| 18 | + Form.setStyleSheet("background-color: rgb(0, 0, 0);") |
| 19 | + self.boton_uno = QtWidgets.QPushButton(Form) |
| 20 | + self.boton_uno.setGeometry(QtCore.QRect(12, 52, 75, 35)) |
| 21 | + self.boton_uno.setStyleSheet("background-color: rgb(0, 170, 255);\n" |
| 22 | +"font: 87 14pt \"Arial Black\";") |
| 23 | + self.boton_uno.setObjectName("boton_uno") |
| 24 | + self.boton_dos = QtWidgets.QPushButton(Form) |
| 25 | + self.boton_dos.setGeometry(QtCore.QRect(93, 52, 75, 35)) |
| 26 | + self.boton_dos.setStyleSheet("background-color: rgb(0, 170, 255);\n" |
| 27 | +"font: 87 14pt \"Arial Black\";") |
| 28 | + self.boton_dos.setObjectName("boton_dos") |
| 29 | + self.boton_tres = QtWidgets.QPushButton(Form) |
| 30 | + self.boton_tres.setGeometry(QtCore.QRect(174, 52, 75, 35)) |
| 31 | + self.boton_tres.setStyleSheet("background-color: rgb(0, 170, 255);\n" |
| 32 | +"font: 87 14pt \"Arial Black\";") |
| 33 | + self.boton_tres.setObjectName("boton_tres") |
| 34 | + self.boton_abrir = QtWidgets.QPushButton(Form) |
| 35 | + self.boton_abrir.setGeometry(QtCore.QRect(255, 52, 75, 35)) |
| 36 | + self.boton_abrir.setStyleSheet("background-color: rgb(0, 170, 127);\n" |
| 37 | +"font: 87 14pt \"Arial Black\";") |
| 38 | + self.boton_abrir.setObjectName("boton_abrir") |
| 39 | + self.valor = QtWidgets.QLabel(Form) |
| 40 | + self.valor.setGeometry(QtCore.QRect(10, 10, 321, 31)) |
| 41 | + self.valor.setStyleSheet("background-color: rgb(170, 255, 255);\n" |
| 42 | +"font: 87 14pt \"Arial Black\";") |
| 43 | + self.valor.setText("") |
| 44 | + self.valor.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) |
| 45 | + self.valor.setIndent(0) |
| 46 | + self.valor.setObjectName("valor") |
| 47 | + self.label_2 = QtWidgets.QLabel(Form) |
| 48 | + self.label_2.setGeometry(QtCore.QRect(10, 10, 321, 31)) |
| 49 | + self.label_2.setStyleSheet("background-color: rgb(170, 255, 255);\n" |
| 50 | +"font: 87 14pt \"Arial Black\";") |
| 51 | + self.label_2.setText("") |
| 52 | + self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) |
| 53 | + self.label_2.setIndent(0) |
| 54 | + self.label_2.setObjectName("label_2") |
| 55 | + self.boton_cinco = QtWidgets.QPushButton(Form) |
| 56 | + self.boton_cinco.setGeometry(QtCore.QRect(93, 95, 75, 35)) |
| 57 | + self.boton_cinco.setStyleSheet("background-color: rgb(0, 170, 255);\n" |
| 58 | +"font: 87 14pt \"Arial Black\";") |
| 59 | + self.boton_cinco.setObjectName("boton_cinco") |
| 60 | + self.boton_seis = QtWidgets.QPushButton(Form) |
| 61 | + self.boton_seis.setGeometry(QtCore.QRect(174, 95, 75, 35)) |
| 62 | + self.boton_seis.setStyleSheet("background-color: rgb(0, 170, 255);\n" |
| 63 | +"font: 87 14pt \"Arial Black\";") |
| 64 | + self.boton_seis.setObjectName("boton_seis") |
| 65 | + self.boton_cerrar = QtWidgets.QPushButton(Form) |
| 66 | + self.boton_cerrar.setGeometry(QtCore.QRect(255, 95, 75, 35)) |
| 67 | + self.boton_cerrar.setStyleSheet("background-color: rgb(0, 170, 127);\n" |
| 68 | +"font: 87 14pt \"Arial Black\";") |
| 69 | + self.boton_cerrar.setObjectName("boton_cerrar") |
| 70 | + self.boton_cuatro = QtWidgets.QPushButton(Form) |
| 71 | + self.boton_cuatro.setGeometry(QtCore.QRect(12, 95, 75, 35)) |
| 72 | + self.boton_cuatro.setStyleSheet("background-color: rgb(0, 170, 255);\n" |
| 73 | +"font: 87 14pt \"Arial Black\";") |
| 74 | + self.boton_cuatro.setObjectName("boton_cuatro") |
| 75 | + self.boton_mas = QtWidgets.QPushButton(Form) |
| 76 | + self.boton_mas.setGeometry(QtCore.QRect(12, 181, 75, 35)) |
| 77 | + self.boton_mas.setStyleSheet("background-color: rgb(0, 170, 127);\n" |
| 78 | +"font: 87 14pt \"Arial Black\";") |
| 79 | + self.boton_mas.setObjectName("boton_mas") |
| 80 | + self.boton_c = QtWidgets.QPushButton(Form) |
| 81 | + self.boton_c.setGeometry(QtCore.QRect(174, 181, 75, 35)) |
| 82 | + self.boton_c.setStyleSheet("background-color: rgb(255, 85, 0);\n" |
| 83 | +"font: 87 14pt \"Arial Black\";") |
| 84 | + self.boton_c.setObjectName("boton_c") |
| 85 | + self.boton_cero = QtWidgets.QPushButton(Form) |
| 86 | + self.boton_cero.setGeometry(QtCore.QRect(93, 181, 75, 35)) |
| 87 | + self.boton_cero.setStyleSheet("background-color: rgb(0, 170, 255);\n" |
| 88 | +"font: 87 14pt \"Arial Black\";") |
| 89 | + self.boton_cero.setObjectName("boton_cero") |
| 90 | + self.boton_menos = QtWidgets.QPushButton(Form) |
| 91 | + self.boton_menos.setGeometry(QtCore.QRect(12, 267, 75, 35)) |
| 92 | + self.boton_menos.setStyleSheet("background-color: rgb(0, 170, 127);\n" |
| 93 | +"font: 87 14pt \"Arial Black\";") |
| 94 | + self.boton_menos.setObjectName("boton_menos") |
| 95 | + self.boton_100 = QtWidgets.QPushButton(Form) |
| 96 | + self.boton_100.setGeometry(QtCore.QRect(93, 267, 75, 35)) |
| 97 | + self.boton_100.setStyleSheet("background-color: rgb(0, 170, 127);\n" |
| 98 | +"font: 87 14pt \"Arial Black\";") |
| 99 | + self.boton_100.setObjectName("boton_100") |
| 100 | + self.boton_salir = QtWidgets.QPushButton(Form) |
| 101 | + self.boton_salir.setGeometry(QtCore.QRect(174, 267, 155, 35)) |
| 102 | + self.boton_salir.setStyleSheet("background-color: rgb(255, 0, 0);\n" |
| 103 | +"font: 87 14pt \"Arial Black\";") |
| 104 | + self.boton_salir.setObjectName("boton_salir") |
| 105 | + self.boton_ac = QtWidgets.QPushButton(Form) |
| 106 | + self.boton_ac.setGeometry(QtCore.QRect(174, 224, 75, 35)) |
| 107 | + self.boton_ac.setStyleSheet("background-color: rgb(255, 85, 0);\n" |
| 108 | +"font: 87 14pt \"Arial Black\";") |
| 109 | + self.boton_ac.setObjectName("boton_ac") |
| 110 | + self.boton_por = QtWidgets.QPushButton(Form) |
| 111 | + self.boton_por.setGeometry(QtCore.QRect(12, 224, 75, 35)) |
| 112 | + self.boton_por.setStyleSheet("background-color: rgb(0, 170, 127);\n" |
| 113 | +"font: 87 14pt \"Arial Black\";") |
| 114 | + self.boton_por.setObjectName("boton_por") |
| 115 | + self.boton_entre = QtWidgets.QPushButton(Form) |
| 116 | + self.boton_entre.setGeometry(QtCore.QRect(93, 224, 75, 35)) |
| 117 | + self.boton_entre.setStyleSheet("background-color: rgb(0, 170, 127);\n" |
| 118 | +"font: 87 14pt \"Arial Black\";") |
| 119 | + self.boton_entre.setObjectName("boton_entre") |
| 120 | + self.boton_igual = QtWidgets.QPushButton(Form) |
| 121 | + self.boton_igual.setGeometry(QtCore.QRect(255, 181, 75, 76)) |
| 122 | + self.boton_igual.setStyleSheet("background-color: rgb(0, 170, 0);\n" |
| 123 | +"font: 87 14pt \"Arial Black\";") |
| 124 | + self.boton_igual.setObjectName("boton_igual") |
| 125 | + self.boton_ocho = QtWidgets.QPushButton(Form) |
| 126 | + self.boton_ocho.setGeometry(QtCore.QRect(93, 138, 75, 35)) |
| 127 | + self.boton_ocho.setStyleSheet("background-color: rgb(0, 170, 255);\n" |
| 128 | +"font: 87 14pt \"Arial Black\";") |
| 129 | + self.boton_ocho.setObjectName("boton_ocho") |
| 130 | + self.boton_siete = QtWidgets.QPushButton(Form) |
| 131 | + self.boton_siete.setGeometry(QtCore.QRect(12, 138, 75, 35)) |
| 132 | + self.boton_siete.setStyleSheet("background-color: rgb(0, 170, 255);\n" |
| 133 | +"font: 87 14pt \"Arial Black\";") |
| 134 | + self.boton_siete.setObjectName("boton_siete") |
| 135 | + self.boton_nueve = QtWidgets.QPushButton(Form) |
| 136 | + self.boton_nueve.setGeometry(QtCore.QRect(174, 138, 75, 35)) |
| 137 | + self.boton_nueve.setStyleSheet("background-color: rgb(0, 170, 255);\n" |
| 138 | +"font: 87 14pt \"Arial Black\";") |
| 139 | + self.boton_nueve.setObjectName("boton_nueve") |
| 140 | + self.boton_punto = QtWidgets.QPushButton(Form) |
| 141 | + self.boton_punto.setGeometry(QtCore.QRect(255, 138, 75, 35)) |
| 142 | + self.boton_punto.setStyleSheet("background-color: rgb(0, 170, 127);\n" |
| 143 | +"font: 87 14pt \"Arial Black\";") |
| 144 | + self.boton_punto.setObjectName("boton_punto") |
| 145 | + self.label_2.raise_() |
| 146 | + self.boton_uno.raise_() |
| 147 | + self.boton_dos.raise_() |
| 148 | + self.boton_tres.raise_() |
| 149 | + self.boton_abrir.raise_() |
| 150 | + self.valor.raise_() |
| 151 | + |
| 152 | + self.retranslateUi(Form) |
| 153 | + self.boton_salir.clicked.connect(Form.close) |
| 154 | + self.boton_c.clicked.connect(self.valor.clear) |
| 155 | + QtCore.QMetaObject.connectSlotsByName(Form) |
| 156 | + |
| 157 | + def retranslateUi(self, Form): |
| 158 | + _translate = QtCore.QCoreApplication.translate |
| 159 | + Form.setWindowTitle(_translate("Form", "Calculadora")) |
| 160 | + self.boton_uno.setText(_translate("Form", "1")) |
| 161 | + self.boton_uno.setShortcut(_translate("Form", "1")) |
| 162 | + self.boton_dos.setText(_translate("Form", "2")) |
| 163 | + self.boton_dos.setShortcut(_translate("Form", "2")) |
| 164 | + self.boton_tres.setText(_translate("Form", "3")) |
| 165 | + self.boton_tres.setShortcut(_translate("Form", "3")) |
| 166 | + self.boton_abrir.setText(_translate("Form", "(")) |
| 167 | + self.boton_abrir.setShortcut(_translate("Form", "Ctrl+8")) |
| 168 | + self.boton_cinco.setText(_translate("Form", "5")) |
| 169 | + self.boton_cinco.setShortcut(_translate("Form", "5")) |
| 170 | + self.boton_seis.setText(_translate("Form", "6")) |
| 171 | + self.boton_seis.setShortcut(_translate("Form", "6")) |
| 172 | + self.boton_cerrar.setText(_translate("Form", ")")) |
| 173 | + self.boton_cerrar.setShortcut(_translate("Form", "Ctrl+9")) |
| 174 | + self.boton_cuatro.setText(_translate("Form", "4")) |
| 175 | + self.boton_mas.setText(_translate("Form", "+")) |
| 176 | + self.boton_mas.setShortcut(_translate("Form", "+")) |
| 177 | + self.boton_c.setText(_translate("Form", "C")) |
| 178 | + self.boton_c.setShortcut(_translate("Form", "Esc")) |
| 179 | + self.boton_cero.setText(_translate("Form", "0")) |
| 180 | + self.boton_menos.setText(_translate("Form", "-")) |
| 181 | + self.boton_menos.setShortcut(_translate("Form", "-")) |
| 182 | + self.boton_100.setText(_translate("Form", "%")) |
| 183 | + self.boton_salir.setText(_translate("Form", "SALIR")) |
| 184 | + self.boton_ac.setText(_translate("Form", "AC")) |
| 185 | + self.boton_ac.setShortcut(_translate("Form", "Backspace")) |
| 186 | + self.boton_por.setText(_translate("Form", "x")) |
| 187 | + self.boton_por.setShortcut(_translate("Form", "Ctrl++")) |
| 188 | + self.boton_entre.setText(_translate("Form", "÷")) |
| 189 | + self.boton_entre.setShortcut(_translate("Form", "Ctrl+7")) |
| 190 | + self.boton_igual.setText(_translate("Form", "=")) |
| 191 | + self.boton_igual.setShortcut(_translate("Form", "Space")) |
| 192 | + self.boton_ocho.setText(_translate("Form", "8")) |
| 193 | + self.boton_ocho.setShortcut(_translate("Form", "8")) |
| 194 | + self.boton_siete.setText(_translate("Form", "7")) |
| 195 | + self.boton_siete.setShortcut(_translate("Form", "7")) |
| 196 | + self.boton_nueve.setText(_translate("Form", "9")) |
| 197 | + self.boton_nueve.setShortcut(_translate("Form", "9")) |
| 198 | + self.boton_punto.setText(_translate("Form", ".")) |
| 199 | + |
| 200 | + |
| 201 | +if __name__ == "__main__": |
| 202 | + import sys |
| 203 | + app = QtWidgets.QApplication(sys.argv) |
| 204 | + Form = QtWidgets.QWidget() |
| 205 | + ui = Ui_Form() |
| 206 | + ui.setupUi(Form) |
| 207 | + Form.show() |
| 208 | + sys.exit(app.exec_()) |
| 209 | + |
0 commit comments