Skip to content

Instantly share code, notes, and snippets.

@jonathan-hepp
Created November 3, 2013 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathan-hepp/7285928 to your computer and use it in GitHub Desktop.
Save jonathan-hepp/7285928 to your computer and use it in GitHub Desktop.
Classe de tela gerada automaticamente pelo pyuic para a aplicação de exemplo demonstrada neste artigo: http://www.jonathanhepp.com.br/2013/11/eventos-no-pyqt-criando-uma-calculadora.html
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'calc.ui'
#
# Created: Sat Nov 2 14:24:15 2013
# by: PyQt4 UI code generator 4.9.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Janela(object):
def setupUi(self, Janela):
Janela.setObjectName(_fromUtf8("Janela"))
Janela.resize(445, 408)
self.centralwidget = QtGui.QWidget(Janela)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.lcd = QtGui.QLCDNumber(self.centralwidget)
self.lcd.setGeometry(QtCore.QRect(20, 20, 401, 101))
self.lcd.setSmallDecimalPoint(False)
self.lcd.setNumDigits(9)
self.lcd.setObjectName(_fromUtf8("lcd"))
self.btNum7 = QtGui.QPushButton(self.centralwidget)
self.btNum7.setGeometry(QtCore.QRect(20, 190, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btNum7.setFont(font)
self.btNum7.setObjectName(_fromUtf8("btNum7"))
self.btNum8 = QtGui.QPushButton(self.centralwidget)
self.btNum8.setGeometry(QtCore.QRect(120, 190, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btNum8.setFont(font)
self.btNum8.setObjectName(_fromUtf8("btNum8"))
self.btNum9 = QtGui.QPushButton(self.centralwidget)
self.btNum9.setGeometry(QtCore.QRect(220, 190, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btNum9.setFont(font)
self.btNum9.setObjectName(_fromUtf8("btNum9"))
self.btNum6 = QtGui.QPushButton(self.centralwidget)
self.btNum6.setGeometry(QtCore.QRect(220, 250, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btNum6.setFont(font)
self.btNum6.setObjectName(_fromUtf8("btNum6"))
self.btNum5 = QtGui.QPushButton(self.centralwidget)
self.btNum5.setGeometry(QtCore.QRect(120, 250, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btNum5.setFont(font)
self.btNum5.setObjectName(_fromUtf8("btNum5"))
self.btNum4 = QtGui.QPushButton(self.centralwidget)
self.btNum4.setGeometry(QtCore.QRect(20, 250, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btNum4.setFont(font)
self.btNum4.setObjectName(_fromUtf8("btNum4"))
self.btNum3 = QtGui.QPushButton(self.centralwidget)
self.btNum3.setGeometry(QtCore.QRect(220, 310, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btNum3.setFont(font)
self.btNum3.setObjectName(_fromUtf8("btNum3"))
self.btNum2 = QtGui.QPushButton(self.centralwidget)
self.btNum2.setGeometry(QtCore.QRect(120, 310, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btNum2.setFont(font)
self.btNum2.setObjectName(_fromUtf8("btNum2"))
self.btNum1 = QtGui.QPushButton(self.centralwidget)
self.btNum1.setGeometry(QtCore.QRect(20, 310, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btNum1.setFont(font)
self.btNum1.setObjectName(_fromUtf8("btNum1"))
self.btNum0 = QtGui.QPushButton(self.centralwidget)
self.btNum0.setGeometry(QtCore.QRect(320, 310, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btNum0.setFont(font)
self.btNum0.setObjectName(_fromUtf8("btNum0"))
self.btDiv = QtGui.QPushButton(self.centralwidget)
self.btDiv.setGeometry(QtCore.QRect(20, 130, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btDiv.setFont(font)
self.btDiv.setObjectName(_fromUtf8("btDiv"))
self.btMult = QtGui.QPushButton(self.centralwidget)
self.btMult.setGeometry(QtCore.QRect(120, 130, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btMult.setFont(font)
self.btMult.setObjectName(_fromUtf8("btMult"))
self.btSubtr = QtGui.QPushButton(self.centralwidget)
self.btSubtr.setGeometry(QtCore.QRect(220, 130, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btSubtr.setFont(font)
self.btSubtr.setObjectName(_fromUtf8("btSubtr"))
self.btSoma = QtGui.QPushButton(self.centralwidget)
self.btSoma.setGeometry(QtCore.QRect(320, 130, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btSoma.setFont(font)
self.btSoma.setObjectName(_fromUtf8("btSoma"))
self.btLimpar = QtGui.QPushButton(self.centralwidget)
self.btLimpar.setGeometry(QtCore.QRect(320, 190, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btLimpar.setFont(font)
self.btLimpar.setObjectName(_fromUtf8("btLimpar"))
self.btResultado = QtGui.QPushButton(self.centralwidget)
self.btResultado.setGeometry(QtCore.QRect(320, 250, 99, 61))
font = QtGui.QFont()
font.setPointSize(20)
self.btResultado.setFont(font)
self.btResultado.setObjectName(_fromUtf8("btResultado"))
Janela.setCentralWidget(self.centralwidget)
self.statusbar = QtGui.QStatusBar(Janela)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
Janela.setStatusBar(self.statusbar)
self.retranslateUi(Janela)
QtCore.QMetaObject.connectSlotsByName(Janela)
def retranslateUi(self, Janela):
Janela.setWindowTitle(QtGui.QApplication.translate("Janela", "Calculadora", None, QtGui.QApplication.UnicodeUTF8))
self.btNum7.setText(QtGui.QApplication.translate("Janela", "7", None, QtGui.QApplication.UnicodeUTF8))
self.btNum7.setShortcut(QtGui.QApplication.translate("Janela", "7", None, QtGui.QApplication.UnicodeUTF8))
self.btNum8.setText(QtGui.QApplication.translate("Janela", "8", None, QtGui.QApplication.UnicodeUTF8))
self.btNum8.setShortcut(QtGui.QApplication.translate("Janela", "8", None, QtGui.QApplication.UnicodeUTF8))
self.btNum9.setText(QtGui.QApplication.translate("Janela", "9", None, QtGui.QApplication.UnicodeUTF8))
self.btNum9.setShortcut(QtGui.QApplication.translate("Janela", "9", None, QtGui.QApplication.UnicodeUTF8))
self.btNum6.setText(QtGui.QApplication.translate("Janela", "6", None, QtGui.QApplication.UnicodeUTF8))
self.btNum6.setShortcut(QtGui.QApplication.translate("Janela", "6", None, QtGui.QApplication.UnicodeUTF8))
self.btNum5.setText(QtGui.QApplication.translate("Janela", "5", None, QtGui.QApplication.UnicodeUTF8))
self.btNum5.setShortcut(QtGui.QApplication.translate("Janela", "5", None, QtGui.QApplication.UnicodeUTF8))
self.btNum4.setText(QtGui.QApplication.translate("Janela", "4", None, QtGui.QApplication.UnicodeUTF8))
self.btNum4.setShortcut(QtGui.QApplication.translate("Janela", "4", None, QtGui.QApplication.UnicodeUTF8))
self.btNum3.setText(QtGui.QApplication.translate("Janela", "3", None, QtGui.QApplication.UnicodeUTF8))
self.btNum3.setShortcut(QtGui.QApplication.translate("Janela", "3", None, QtGui.QApplication.UnicodeUTF8))
self.btNum2.setText(QtGui.QApplication.translate("Janela", "2", None, QtGui.QApplication.UnicodeUTF8))
self.btNum2.setShortcut(QtGui.QApplication.translate("Janela", "2", None, QtGui.QApplication.UnicodeUTF8))
self.btNum1.setText(QtGui.QApplication.translate("Janela", "1", None, QtGui.QApplication.UnicodeUTF8))
self.btNum1.setShortcut(QtGui.QApplication.translate("Janela", "1", None, QtGui.QApplication.UnicodeUTF8))
self.btNum0.setText(QtGui.QApplication.translate("Janela", "0", None, QtGui.QApplication.UnicodeUTF8))
self.btNum0.setShortcut(QtGui.QApplication.translate("Janela", "0", None, QtGui.QApplication.UnicodeUTF8))
self.btDiv.setText(QtGui.QApplication.translate("Janela", "/", None, QtGui.QApplication.UnicodeUTF8))
self.btDiv.setShortcut(QtGui.QApplication.translate("Janela", "/", None, QtGui.QApplication.UnicodeUTF8))
self.btMult.setText(QtGui.QApplication.translate("Janela", "*", None, QtGui.QApplication.UnicodeUTF8))
self.btMult.setShortcut(QtGui.QApplication.translate("Janela", "*", None, QtGui.QApplication.UnicodeUTF8))
self.btSubtr.setText(QtGui.QApplication.translate("Janela", "-", None, QtGui.QApplication.UnicodeUTF8))
self.btSubtr.setShortcut(QtGui.QApplication.translate("Janela", "-", None, QtGui.QApplication.UnicodeUTF8))
self.btSoma.setText(QtGui.QApplication.translate("Janela", "+", None, QtGui.QApplication.UnicodeUTF8))
self.btSoma.setShortcut(QtGui.QApplication.translate("Janela", "+", None, QtGui.QApplication.UnicodeUTF8))
self.btLimpar.setText(QtGui.QApplication.translate("Janela", "C", None, QtGui.QApplication.UnicodeUTF8))
self.btLimpar.setShortcut(QtGui.QApplication.translate("Janela", "Backspace", None, QtGui.QApplication.UnicodeUTF8))
self.btResultado.setText(QtGui.QApplication.translate("Janela", "=", None, QtGui.QApplication.UnicodeUTF8))
self.btResultado.setShortcut(QtGui.QApplication.translate("Janela", "Return", None, QtGui.QApplication.UnicodeUTF8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment