From ad10b066529c37f73bace755558908cdda52d35d Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Fri, 14 Nov 2014 07:46:10 -0500 Subject: [PATCH] Correction for spinbox auto-selection without suffix --- pyqtgraph/widgets/SpinBox.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pyqtgraph/widgets/SpinBox.py b/pyqtgraph/widgets/SpinBox.py index 1d8600c4..47101405 100644 --- a/pyqtgraph/widgets/SpinBox.py +++ b/pyqtgraph/widgets/SpinBox.py @@ -240,11 +240,14 @@ class SpinBox(QtGui.QAbstractSpinBox): """ le = self.lineEdit() text = asUnicode(le.text()) - try: - index = text.index(' ') - except ValueError: - return - le.setSelection(0, index) + if self.opts['suffix'] == '': + le.setSelection(0, len(text)) + else: + try: + index = text.index(' ') + except ValueError: + return + le.setSelection(0, index) def value(self): """