Small fix to make sure the cursor stays where it is using the Pro GUI
This commit is contained in:
@@ -54,6 +54,7 @@ ALIAS_REGEXP = '^(|([\w\-\.]+)@)((\w[\w\-]+\.)+[\w\-]+)$'
|
|||||||
|
|
||||||
def numbify(entry, is_int = False):
|
def numbify(entry, is_int = False):
|
||||||
text = unicode(entry.text()).strip()
|
text = unicode(entry.text()).strip()
|
||||||
|
pos = entry.cursorPosition()
|
||||||
chars = '0123456789'
|
chars = '0123456789'
|
||||||
if not is_int: chars +='.'
|
if not is_int: chars +='.'
|
||||||
s = ''.join([i for i in text if i in chars])
|
s = ''.join([i for i in text if i in chars])
|
||||||
@@ -72,6 +73,7 @@ def numbify(entry, is_int = False):
|
|||||||
except:
|
except:
|
||||||
amount = None
|
amount = None
|
||||||
entry.setText(s)
|
entry.setText(s)
|
||||||
|
entry.setCursorPosition(pos)
|
||||||
return amount
|
return amount
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user