commit
01c349e14b
@ -509,8 +509,14 @@ class SpinBox(QtGui.QAbstractSpinBox):
|
|||||||
def fixup(self, strn):
|
def fixup(self, strn):
|
||||||
# fixup is called when the spinbox loses focus with an invalid or intermediate string
|
# fixup is called when the spinbox loses focus with an invalid or intermediate string
|
||||||
self.updateText()
|
self.updateText()
|
||||||
|
|
||||||
|
# support both PyQt APIs (for Python 2 and 3 respectively)
|
||||||
|
# http://pyqt.sourceforge.net/Docs/PyQt4/python_v3.html#qvalidator
|
||||||
|
try:
|
||||||
strn.clear()
|
strn.clear()
|
||||||
strn.append(self.lineEdit().text())
|
strn.append(self.lineEdit().text())
|
||||||
|
except AttributeError:
|
||||||
|
return self.lineEdit().text()
|
||||||
|
|
||||||
def interpret(self):
|
def interpret(self):
|
||||||
"""Return value of text or False if text is invalid."""
|
"""Return value of text or False if text is invalid."""
|
||||||
|
Loading…
Reference in New Issue
Block a user