From 5ddbb611d1c3e428c0dfda85e105d8e1b727542b Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 30 Nov 2016 09:18:09 -0800 Subject: [PATCH] spinbox selects only numerical portion of text on focus-in --- pyqtgraph/widgets/SpinBox.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyqtgraph/widgets/SpinBox.py b/pyqtgraph/widgets/SpinBox.py index 50429dee..86cbba93 100644 --- a/pyqtgraph/widgets/SpinBox.py +++ b/pyqtgraph/widgets/SpinBox.py @@ -264,6 +264,10 @@ class SpinBox(QtGui.QAbstractSpinBox): return le.setSelection(0, index) + def focusInEvent(self, ev): + super(SpinBox, self).focusInEvent(ev) + self.selectNumber() + def value(self): """ Return the value of this SpinBox.