mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-11 08:17:09 +08:00
BUG: Initialize QApplication when creating Plugin.
QWidgets cannot be initialized unless QApplication has been created. In cases where the Plugin is created before the ImageViewer, ensure that QApplication exists.
This commit is contained in:
@@ -14,7 +14,7 @@ try:
|
||||
except ImportError:
|
||||
print("Could not import matplotlib -- skimage.viewer not available.")
|
||||
|
||||
from ..utils import RequiredAttr
|
||||
from ..utils import RequiredAttr, init_qtapp
|
||||
|
||||
|
||||
class Plugin(QDialog):
|
||||
@@ -82,6 +82,7 @@ class Plugin(QDialog):
|
||||
draws_on_image = False
|
||||
|
||||
def __init__(self, image_filter=None, height=0, width=400, useblit=None):
|
||||
init_qtapp()
|
||||
super(Plugin, self).__init__()
|
||||
|
||||
self.image_viewer = None
|
||||
|
||||
Reference in New Issue
Block a user