From dbfd884347d8bda34f8ff47bf962f334146a6c35 Mon Sep 17 00:00:00 2001 From: nyanpasu64 Date: Tue, 15 Mar 2022 11:34:48 -0700 Subject: [PATCH] Replace PyQt5 with qtpy (doesn't work) --- corrscope/gui/__init__.py | 8 ++++---- corrscope/gui/history_file_dlg.py | 2 +- corrscope/gui/model_bind.py | 8 ++++---- corrscope/gui/util.py | 4 ++-- corrscope/gui/view_mainwindow.py | 4 ++-- corrscope/gui/view_stack.py | 4 ++-- corrscope/gui/widgets.py | 8 ++++---- tests/test_gui.py | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/corrscope/gui/__init__.py b/corrscope/gui/__init__.py index d0aa831..6d51c64 100644 --- a/corrscope/gui/__init__.py +++ b/corrscope/gui/__init__.py @@ -8,11 +8,11 @@ from pathlib import Path from types import MethodType from typing import Optional, List, Any, Tuple, Callable, Union, Dict, Sequence, NewType -import PyQt5.QtCore as qc -import PyQt5.QtWidgets as qw +import qtpy.QtCore as qc +import qtpy.QtWidgets as qw import attr -from PyQt5.QtCore import QModelIndex, Qt, QVariant -from PyQt5.QtGui import QFont, QCloseEvent, QDesktopServices +from qtpy.QtCore import QModelIndex, Qt, QVariant +from qtpy.QtGui import QFont, QCloseEvent, QDesktopServices import corrscope import corrscope.settings.global_prefs as gp diff --git a/corrscope/gui/history_file_dlg.py b/corrscope/gui/history_file_dlg.py index 4d47005..1b698b5 100644 --- a/corrscope/gui/history_file_dlg.py +++ b/corrscope/gui/history_file_dlg.py @@ -2,7 +2,7 @@ import os.path from pathlib import Path from typing import * -import PyQt5.QtWidgets as qw +import qtpy.QtWidgets as qw import attr import corrscope.settings.global_prefs as _gp diff --git a/corrscope/gui/model_bind.py b/corrscope/gui/model_bind.py index 750b8e0..bd270e6 100644 --- a/corrscope/gui/model_bind.py +++ b/corrscope/gui/model_bind.py @@ -4,10 +4,10 @@ from collections import defaultdict from typing import * import attr -from PyQt5 import QtWidgets as qw, QtCore as qc -from PyQt5.QtCore import pyqtSlot -from PyQt5.QtGui import QPalette, QColor, QFont -from PyQt5.QtWidgets import QWidget +from qtpy import QtWidgets as qw, QtCore as qc +from qtpy.QtCore import pyqtSlot +from qtpy.QtGui import QPalette, QColor, QFont +from qtpy.QtWidgets import QWidget from corrscope.config import CorrError, DumpableAttrs, get_units from corrscope.gui.util import color2hex diff --git a/corrscope/gui/util.py b/corrscope/gui/util.py index d67b12c..3b48909 100644 --- a/corrscope/gui/util.py +++ b/corrscope/gui/util.py @@ -4,8 +4,8 @@ from operator import itemgetter from typing import TypeVar, Iterable, Generic, Tuple, Any, Optional import matplotlib.colors -from PyQt5.QtCore import QMutex -from PyQt5.QtWidgets import QErrorMessage, QWidget +from qtpy.QtCore import QMutex +from qtpy.QtWidgets import QErrorMessage, QWidget from corrscope.config import CorrError diff --git a/corrscope/gui/view_mainwindow.py b/corrscope/gui/view_mainwindow.py index 9ca2380..ae643a2 100644 --- a/corrscope/gui/view_mainwindow.py +++ b/corrscope/gui/view_mainwindow.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- from contextlib import contextmanager -from PyQt5.QtCore import * -from PyQt5.QtWidgets import * +from qtpy.QtCore import * +from qtpy.QtWidgets import * from corrscope.gui.view_stack import ( LayoutStack, diff --git a/corrscope/gui/view_stack.py b/corrscope/gui/view_stack.py index 4b71ab1..a89ebdf 100644 --- a/corrscope/gui/view_stack.py +++ b/corrscope/gui/view_stack.py @@ -2,8 +2,8 @@ from contextlib import contextmanager from typing import * import attr -from PyQt5.QtCore import QObject, Qt -from PyQt5.QtWidgets import * +from qtpy.QtCore import QObject, Qt +from qtpy.QtWidgets import * from corrscope.util import obj_name diff --git a/corrscope/gui/widgets.py b/corrscope/gui/widgets.py index 1fd0262..b526f2f 100644 --- a/corrscope/gui/widgets.py +++ b/corrscope/gui/widgets.py @@ -1,9 +1,9 @@ from typing import TYPE_CHECKING, List, Callable -from PyQt5 import QtWidgets as qw, QtCore as qc -from PyQt5.QtCore import Qt -from PyQt5.QtGui import QKeySequence -from PyQt5.QtWidgets import QShortcut +from qtpy import QtWidgets as qw, QtCore as qc +from qtpy.QtCore import Qt +from qtpy.QtGui import QKeySequence +from qtpy.QtWidgets import QShortcut from corrscope.gui.util import find_ranges diff --git a/tests/test_gui.py b/tests/test_gui.py index b9e51fd..c6b13fe 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -1,4 +1,4 @@ -import PyQt5.QtWidgets as qw +import qtpy.QtWidgets as qw from corrscope import gui from corrscope.corrscope import template_config