From eddd007df97560a0eaa9447af919d8914615d276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Sat, 4 Mar 2023 07:44:09 -0300 Subject: [PATCH] =?UTF-8?q?Calculadora:=20adicionando=20a=C3=A7=C3=B5es=20?= =?UTF-8?q?nas=20teclas=20C,=20D=20e=20sinal=20de=20igual?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula202-calculadora/display.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/aula202-calculadora/display.py b/aula202-calculadora/display.py index d225525..a11335b 100644 --- a/aula202-calculadora/display.py +++ b/aula202-calculadora/display.py @@ -27,17 +27,18 @@ class Display(QLineEdit): key = event.key() KEYS = Qt.Key - isEnter = key in [KEYS.Key_Enter, KEYS.Key_Return] - isDelete = key in [KEYS.Key_Backspace, KEYS.Key_Delete] - isEsc = key in [KEYS.Key_Escape] + isEnter = key in [KEYS.Key_Enter, KEYS.Key_Return, KEYS.Key_Equal] + isDelete = key in [KEYS.Key_Backspace, KEYS.Key_Delete, KEYS.Key_D] + isEsc = key in [KEYS.Key_Escape, KEYS.Key_C] if isEnter: - print('Enter pressionado, sinal emitido', type(self).__name__) + print(f'EQ {text} pressionado, sinal emitido', type(self).__name__) self.eqPressed.emit() return event.ignore() if isDelete: - print('isDelete pressionado, sinal emitido', type(self).__name__) + print(f'isDelete {text} pressionado, sinal emitido', + type(self).__name__) self.delPressed.emit() return event.ignore()