1
0

handle shortcut explicitly

This commit is contained in:
ecdsa
2013-04-07 22:08:56 +02:00
parent 35ecbff7a5
commit ef3ae450f3
2 changed files with 6 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ class AmountEdit(QLineEdit):
self.text_getter = text_getter
self.textChanged.connect(self.numbify)
self.is_int = is_int
self.is_shortcut = False
def paintEvent(self, event):
@@ -27,6 +28,8 @@ class AmountEdit(QLineEdit):
def numbify(self):
text = unicode(self.text()).strip()
if text == '!':
self.is_shortcut = True
pos = self.cursorPosition()
chars = '0123456789'
if not self.is_int: chars +='.'