From fe358929a19ae5a4296612f305a40d84e37e99c9 Mon Sep 17 00:00:00 2001 From: Seth Hitefield <sdh11@vt.edu> Date: Wed, 8 Apr 2015 18:46:15 -0400 Subject: qtgui: Fixed issue where clicking on the range widget jumped to the wrong location --- gr-qtgui/python/qtgui/range.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gr-qtgui/python/qtgui/range.py') diff --git a/gr-qtgui/python/qtgui/range.py b/gr-qtgui/python/qtgui/range.py index bdc6e59954..168e6662c3 100755 --- a/gr-qtgui/python/qtgui/range.py +++ b/gr-qtgui/python/qtgui/range.py @@ -156,7 +156,15 @@ class RangeWidget(QtGui.QWidget): new = self.minimum() + ((self.maximum()-self.minimum()) * event.x()) / self.width() self.setValue(new) event.accept() - QtGui.QSlider.mousePressEvent(self, event) + # Use repaint rather than calling the super mousePressEvent. + # Calling super causes issue where slider jumps to wrong value. + QtGui.QSlider.repaint(self) + + def mouseMoveEvent(self, event): + new = self.minimum() + ((self.maximum()-self.minimum()) * event.x()) / self.width() + self.setValue(new) + event.accept() + QtGui.QSlider.repaint(self) class Counter(QtGui.QDoubleSpinBox): """ Creates the range using a counter """ -- cgit v1.2.3