mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-11 12:43:04 +08:00
Update viewer for PyQt5 compatibility
Conflicts: skimage/viewer/tests/test_plugins.py skimage/viewer/tests/test_tools.py
This commit is contained in:
@@ -4,19 +4,11 @@ Base class for Plugins that interact with ImageViewer.
|
||||
from warnings import warn
|
||||
|
||||
import numpy as np
|
||||
|
||||
from ..qt import QtGui, qt_api
|
||||
from ..qt.QtCore import Qt, Signal
|
||||
from ..qt import QtWidgets, QtCore, Signal
|
||||
from ..utils import RequiredAttr, init_qtapp
|
||||
from skimage._shared.testing import doctest_skip_parser
|
||||
|
||||
if qt_api is not None:
|
||||
has_qt = True
|
||||
else:
|
||||
has_qt = False
|
||||
|
||||
|
||||
class Plugin(QtGui.QDialog):
|
||||
class Plugin(QtWidgets.QDialog):
|
||||
"""Base class for plugins that interact with an ImageViewer.
|
||||
|
||||
A plugin connects an image filter (or another function) to an image viewer.
|
||||
@@ -101,7 +93,7 @@ class Plugin(QtGui.QDialog):
|
||||
"then the `image_filter` argument is ignored.")
|
||||
|
||||
self.setWindowTitle(self.name)
|
||||
self.layout = QtGui.QGridLayout(self)
|
||||
self.layout = QtWidgets.QGridLayout(self)
|
||||
self.resize(width, height)
|
||||
self.row = 0
|
||||
|
||||
@@ -124,7 +116,7 @@ class Plugin(QtGui.QDialog):
|
||||
the image matches the filtered value specified by attached widgets.
|
||||
"""
|
||||
self.setParent(image_viewer)
|
||||
self.setWindowFlags(Qt.Dialog)
|
||||
self.setWindowFlags(QtCore.Qt.Dialog)
|
||||
|
||||
self.image_viewer = image_viewer
|
||||
self.image_viewer.plugins.append(self)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import numpy as np
|
||||
try:
|
||||
import matplotlib.pyplot as plt
|
||||
except ImportError:
|
||||
pass
|
||||
import matplotlib.pyplot as plt
|
||||
from skimage import color
|
||||
from skimage import exposure
|
||||
from .plotplugin import PlotPlugin
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import numpy as np
|
||||
from ..qt import QtGui
|
||||
|
||||
from ..qt import QtGui
|
||||
from ..utils import new_plot
|
||||
from .base import Plugin
|
||||
|
||||
|
||||
Reference in New Issue
Block a user