diff options
author | Seth Hitefield <sdh11@vt.edu> | 2015-04-08 18:46:15 -0400 |
---|---|---|
committer | Seth Hitefield <sdh11@vt.edu> | 2015-04-08 18:46:15 -0400 |
commit | fe358929a19ae5a4296612f305a40d84e37e99c9 (patch) | |
tree | 7c1b786d0b2078f80dce89574de5876cbff5a555 /gr-qtgui/python/qtgui/range.py | |
parent | 8c88269641075d9bc02112dbf2f814779723cc5f (diff) |
qtgui: Fixed issue where clicking on the range widget jumped to the wrong location
Diffstat (limited to 'gr-qtgui/python/qtgui/range.py')
-rwxr-xr-x | gr-qtgui/python/qtgui/range.py | 10 |
1 files changed, 9 insertions, 1 deletions
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 """ |