Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a78f4a3

Browse files
finalizandoCalc
1 parent 80227ce commit a78f4a3

File tree

7 files changed

+136
-123
lines changed

7 files changed

+136
-123
lines changed

‎.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎__pycache__/calculadora.cpython-310.pyc

3.87 KB
Binary file not shown.

‎calculadora.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from PyQt5 import uic, QtWidgets, QtGui
1+
from PyQt5 import uic, QtWidgets, QtGui
22

33
valores = ''
44

@@ -12,7 +12,9 @@ def limpar_tela():
1212
def botao_neg_pos():
1313
global valores
1414
sinal_neg = '-'
15-
if valores[0] != '-':
15+
if valores == '':
16+
pass
17+
elif valores[0] != '-':
1618
valores = sinal_neg + valores
1719
elif valores[0] == '-':
1820
valores = valores[1:]
@@ -23,7 +25,6 @@ def botao_del():
2325
global valores
2426
valores = valores[:-1]
2527
tela_calculadora.label_display.setText(valores)
26-
print(valores)
2728

2829

2930
def botao_dividir():
@@ -162,7 +163,6 @@ def botao_voltar():
162163
tela_calculadora.setWindowIcon(QtGui.QIcon('imagens/calculadora-icon.png'))
163164
tela_calculadora.setWindowTitle('Calculadora')
164165

165-
166166
tela_calculadora.btn_C.clicked.connect(limpar_tela)
167167
tela_calculadora.btn_positivoNegativo.clicked.connect(botao_neg_pos)
168168
tela_calculadora.btn_del.clicked.connect(botao_del)
@@ -184,6 +184,5 @@ def botao_voltar():
184184
tela_calculadora.btn_igual.clicked.connect(botao_igual)
185185
tela_calculadora.btn_voltar.clicked.connect(botao_voltar)
186186

187-
188187
tela_calculadora.show()
189188
app.exec()

‎imagens/application-icon.png

1.05 KB
Loading[フレーム]

‎imagens/favicon.png

-448 Bytes
Binary file not shown.

‎main.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ def chamar_sobre():
55
print('cliquei em sobre')
66

77

8+
def chamar_calculadora():
9+
import calculadora
10+
calculadora.tela_calculadora.show()
11+
calculadora.app.exec()
12+
13+
814
app = QtWidgets.QApplication([])
915
tela_main = uic.loadUi('tela_main.ui')
10-
tela_main.setWindowIcon(QtGui.QIcon('imagens/favicon.png'))
16+
tela_main.setWindowIcon(QtGui.QIcon('imagens/application-icon.png'))
1117
tela_main.setWindowTitle('Projetos Python')
12-
tela_main.btn_sobre.clicked.connect(chamar_sobre)
1318

19+
tela_main.btn_sobre.clicked.connect(chamar_sobre)
20+
tela_main.btn_calculadora.clicked.connect(chamar_calculadora)
1421

1522
tela_main.show()
1623
app.exec()
17-

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /