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:
Tony S Yu committed 2012-09-04 22:07:59 -04:00
1 parent fe41023370
commit d1e012ea30
1 file changed
+2 -1
+2 -1
View File
@@ -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