gui: remove pyqt4 support code

This commit is contained in:
Sebastien Bourdeauducq 2016-01-10 18:38:24 +08:00
parent e6e6b27ba9
commit 6a972eb591
3 changed files with 5 additions and 20 deletions

View File

@ -10,11 +10,6 @@ from pyqtgraph import LayoutWidget
from artiq.tools import short_format from artiq.tools import short_format
from artiq.gui.models import DictSyncTreeSepModel from artiq.gui.models import DictSyncTreeSepModel
try:
QSortFilterProxyModel = QtCore.QSortFilterProxyModel
except AttributeError:
QSortFilterProxyModel = QtGui.QSortFilterProxyModel
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -63,6 +58,6 @@ class DatasetsDock(dockarea.Dock):
def set_model(self, model): def set_model(self, model):
self.table_model = 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_model_filter.setSourceModel(self.table_model)
self.table.setModel(self.table_model_filter) self.table.setModel(self.table_model_filter)

View File

@ -8,11 +8,6 @@ from pyqtgraph import dockarea, LayoutWidget
from artiq.gui.tools import log_level_to_name from artiq.gui.tools import log_level_to_name
try:
QSortFilterProxyModel = QtCore.QSortFilterProxyModel
except AttributeError:
QSortFilterProxyModel = QtGui.QSortFilterProxyModel
class Model(QtCore.QAbstractTableModel): class Model(QtCore.QAbstractTableModel):
def __init__(self, init): def __init__(self, init):
@ -107,9 +102,9 @@ class Model(QtCore.QAbstractTableModel):
return v[3] return v[3]
class _LogFilterProxyModel(QSortFilterProxyModel): class _LogFilterProxyModel(QtCore.QSortFilterProxyModel):
def __init__(self, min_level, freetext): def __init__(self, min_level, freetext):
QSortFilterProxyModel.__init__(self) QtCore.QSortFilterProxyModel.__init__(self)
self.min_level = min_level self.min_level = min_level
self.freetext = freetext self.freetext = freetext

View File

@ -1,13 +1,8 @@
import logging import logging
from functools import partial from functools import partial
from quamash import QtGui, QtCore from quamash import QtGui, QtCore, QtWidgets
from pyqtgraph import dockarea from pyqtgraph import dockarea
try:
from quamash import QtWidgets
QShortcut = QtWidgets.QShortcut
except:
QShortcut = QtGui.QShortcut
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -66,7 +61,7 @@ class ShortcutsDock(dockarea.Dock):
"open": open, "open": open,
"submit": submit "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.setContext(QtCore.Qt.ApplicationShortcut)
shortcut.activated.connect(partial(self._activated, i)) shortcut.activated.connect(partial(self._activated, i))