mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-28 19:49:17 +08:00
Fix PySide compatibility for signal defs
This commit is contained in:
@@ -6,7 +6,7 @@ from warnings import warn
|
||||
import numpy as np
|
||||
|
||||
from ..qt import QtGui
|
||||
from ..qt.QtCore import Qt, pyqtSignal
|
||||
from ..qt.QtCore import Qt, Signal
|
||||
from ..utils import RequiredAttr, init_qtapp
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ class Plugin(QtGui.QDialog):
|
||||
image_viewer = RequiredAttr("%s is not attached to ImageViewer" % name)
|
||||
|
||||
# Signals used when viewers are linked to the Plugin output.
|
||||
image_updated = pyqtSignal(np.ndarray)
|
||||
_started = pyqtSignal(int)
|
||||
image_updated = Signal(np.ndarray)
|
||||
_started = Signal(int)
|
||||
|
||||
def __init__(self, image_filter=None, height=0, width=400, useblit=True,
|
||||
dock='bottom'):
|
||||
|
||||
@@ -4,6 +4,9 @@ if qt_api == 'pyside':
|
||||
from PySide.QtCore import *
|
||||
elif qt_api == 'pyqt':
|
||||
from PyQt4.QtCore import *
|
||||
# Use pyside names for signals and slots
|
||||
Signal = pyqtSignal
|
||||
Slot = pyqtSlot
|
||||
else:
|
||||
# Mock objects for buildbot (which doesn't have Qt, but imports viewer).
|
||||
class Qt(object):
|
||||
@@ -12,5 +15,8 @@ else:
|
||||
LeftDockWidgetArea = None
|
||||
RightDockWidgetArea = None
|
||||
|
||||
def pyqtSignal(*args, **kwargs):
|
||||
def Signal(*args, **kwargs):
|
||||
pass
|
||||
|
||||
def Slot(*args, **kwargs):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user