[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 09/13: qtgui: range control -> jump to near
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 09/13: qtgui: range control -> jump to nearest step with left click |
Date: |
Fri, 3 Apr 2015 19:59:35 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 7c6946e4738a4c4afd2ba49acbf865b6ee4d4f4b
Author: Bill Clark <address@hidden>
Date: Fri Apr 3 14:20:15 2015 -0400
qtgui: range control -> jump to nearest step with left click
---
gr-qtgui/python/qtgui/range.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/gr-qtgui/python/qtgui/range.py b/gr-qtgui/python/qtgui/range.py
index 9f369d6..61eee03 100755
--- a/gr-qtgui/python/qtgui/range.py
+++ b/gr-qtgui/python/qtgui/range.py
@@ -107,6 +107,19 @@ class RangeWidget(QtGui.QWidget):
self.setTickPosition(2)
self.valueChanged.connect(slot)
+ def mousePressEvent(self, event):
+ #opt_style = QtGui.QStyleOption.init(None)
+ #self.initStyleOption(opt_style)
+ #sr =
(self.style()).subControlRect(QtGui.QStyle.CC_Slider,opt_style,QtGui.QStyle.SC_SliderHandle,parent)
+ if((event.button() == QtCore.Qt.LeftButton)):# and
(sr.contains(event.pos()) == False)):
+ newVal = self.minimum() + ((self.maximum()-self.minimum()) *
event.x()) / self.width()
+ #if self.invertedAppearance():
+ # self.setValue(self.maximum() - newVal)
+ #else:
+ self.setValue(newVal)
+ event.accept()
+ QtGui.QSlider.mousePressEvent(self, event)
+
class Counter(QtGui.QDoubleSpinBox):
""" Creates the range using a counter """
def __init__(self, parent, ranges, slot):
- [Commit-gnuradio] [gnuradio] branch master updated (6ff4e45 -> 8939e2e), git, 2015/04/03
- [Commit-gnuradio] [gnuradio] 03/13: qtgui: Fixed bug that did not allow multiple range objects in a single flow graph, git, 2015/04/03
- [Commit-gnuradio] [gnuradio] 09/13: qtgui: range control -> jump to nearest step with left click,
git <=
- [Commit-gnuradio] [gnuradio] 12/13: Merge remote-tracking branch 'saikwolf/qtgui_range_improvements', git, 2015/04/03
- [Commit-gnuradio] [gnuradio] 13/13: Merge remote-tracking branch 'tom/qtgui/themes_support', git, 2015/04/03
- [Commit-gnuradio] [gnuradio] 10/13: qtgui: range comment cleanup, git, 2015/04/03
- [Commit-gnuradio] [gnuradio] 02/13: do not use deprecated gr_int* types, git, 2015/04/03
- [Commit-gnuradio] [gnuradio] 05/13: qtqui: fixed grc block creation code, git, 2015/04/03
- [Commit-gnuradio] [gnuradio] 04/13: qtgui: Fixed template errors, git, 2015/04/03
- [Commit-gnuradio] [gnuradio] 11/13: Merge remote-tracking branch 'pinkavaj/clear-int-00', git, 2015/04/03
- [Commit-gnuradio] [gnuradio] 08/13: qtgui: Adding a themes directory and install qss files there., git, 2015/04/03
- [Commit-gnuradio] [gnuradio] 06/13: Merge pull request #2 from SaikWolf/pyqwt-removal, git, 2015/04/03
- [Commit-gnuradio] [gnuradio] 01/13: gr-audio: use generic int types instead of gr_int*, git, 2015/04/03