Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 00d4775da5ce
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c08881de5d80
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Mar 8, 2016

  1. Copy the full SHA
    41ca223 View commit details
  2. gui: don't scroll experiment editor on modified wheel (closes #303)

    If you try to target e.g. spinbox with a ctrl- or shift-wheel to change the value
    and you don't aim well, the tree widget will scroll. We already have tree
    scroll on unmodified wheel. Let's have the modified wheel events exclusively
    target the smaller widgets.
    jordens committed Mar 8, 2016
    Copy the full SHA
    c08881d View commit details
Showing with 14 additions and 3 deletions.
  1. +11 −0 artiq/gui/experiments.py
  2. +3 −3 artiq/gui/tools.py
11 changes: 11 additions & 0 deletions artiq/gui/experiments.py
Original file line number Diff line number Diff line change
@@ -18,6 +18,15 @@
# 2. file:<class name>@<file name>


class _WheelFilter(QtCore.QObject):
def eventFilter(self, obj, event):
if (event.type() == QtCore.QEvent.Wheel and
event.modifiers() != QtCore.Qt.NoModifier):
event.ignore()
return True
return False


class _ArgumentEditor(QtWidgets.QTreeWidget):
def __init__(self, manager, dock, expurl):
self.manager = manager
@@ -38,6 +47,8 @@ def __init__(self, manager, dock, expurl):
self.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)
self.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)

self.viewport().installEventFilter(_WheelFilter(self.viewport()))

self._groups = dict()
self._arg_to_entry_widgetitem = dict()

6 changes: 3 additions & 3 deletions artiq/gui/tools.py
Original file line number Diff line number Diff line change
@@ -17,11 +17,11 @@ def log_level_to_name(level):

class _WheelFilter(QtCore.QObject):
def eventFilter(self, obj, event):
if event.type() == QtCore.QEvent.Wheel:
if (event.type() == QtCore.QEvent.Wheel and
event.modifiers() == QtCore.Qt.NoModifier):
event.ignore()
return True
else:
return False
return False


def disable_scroll_wheel(widget):