mirror of
https://github.com/wassname/scikit-image.git
synced 2026-10-30 13:40:44 +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:
1 parent
fe41023370
commit
d1e012ea30
1 file changed
+2
-1
@@ -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