From 6a972eb59132c8d8b3b9cf00e16a86a99cc802db Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 10 Jan 2016 18:38:24 +0800 Subject: [PATCH] gui: remove pyqt4 support code --- artiq/gui/datasets.py | 7 +------ artiq/gui/log.py | 9 ++------- artiq/gui/shortcuts.py | 9 ++------- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/artiq/gui/datasets.py b/artiq/gui/datasets.py index 0e341c082..b70388fa3 100644 --- a/artiq/gui/datasets.py +++ b/artiq/gui/datasets.py @@ -10,11 +10,6 @@ from pyqtgraph import LayoutWidget from artiq.tools import short_format from artiq.gui.models import DictSyncTreeSepModel -try: - QSortFilterProxyModel = QtCore.QSortFilterProxyModel -except AttributeError: - QSortFilterProxyModel = QtGui.QSortFilterProxyModel - logger = logging.getLogger(__name__) @@ -63,6 +58,6 @@ class DatasetsDock(dockarea.Dock): def set_model(self, model): self.table_model = model - self.table_model_filter = QSortFilterProxyModel() + self.table_model_filter = QtCore.QSortFilterProxyModel() self.table_model_filter.setSourceModel(self.table_model) self.table.setModel(self.table_model_filter) diff --git a/artiq/gui/log.py b/artiq/gui/log.py index 6ab5d0ae0..c6d9c4706 100644 --- a/artiq/gui/log.py +++ b/artiq/gui/log.py @@ -8,11 +8,6 @@ from pyqtgraph import dockarea, LayoutWidget from artiq.gui.tools import log_level_to_name -try: - QSortFilterProxyModel = QtCore.QSortFilterProxyModel -except AttributeError: - QSortFilterProxyModel = QtGui.QSortFilterProxyModel - class Model(QtCore.QAbstractTableModel): def __init__(self, init): @@ -107,9 +102,9 @@ class Model(QtCore.QAbstractTableModel): return v[3] -class _LogFilterProxyModel(QSortFilterProxyModel): +class _LogFilterProxyModel(QtCore.QSortFilterProxyModel): def __init__(self, min_level, freetext): - QSortFilterProxyModel.__init__(self) + QtCore.QSortFilterProxyModel.__init__(self) self.min_level = min_level self.freetext = freetext diff --git a/artiq/gui/shortcuts.py b/artiq/gui/shortcuts.py index 07c39f5c4..db05bfa2b 100644 --- a/artiq/gui/shortcuts.py +++ b/artiq/gui/shortcuts.py @@ -1,13 +1,8 @@ import logging from functools import partial -from quamash import QtGui, QtCore +from quamash import QtGui, QtCore, QtWidgets from pyqtgraph import dockarea -try: - from quamash import QtWidgets - QShortcut = QtWidgets.QShortcut -except: - QShortcut = QtGui.QShortcut logger = logging.getLogger(__name__) @@ -66,7 +61,7 @@ class ShortcutsDock(dockarea.Dock): "open": open, "submit": submit } - shortcut = QShortcut("F" + str(i+1), main_window) + shortcut = QtWidgets.QShortcut("F" + str(i+1), main_window) shortcut.setContext(QtCore.Qt.ApplicationShortcut) shortcut.activated.connect(partial(self._activated, i))