-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New stream arg in tabview conflicts with sub classes of ImageView #44
Comments
A similar problem occurred with the metadataviewer. @ronpandolfi fixed it by removing the excludedkeys keyword before the super() call. |
My solution is to change the class DynImageView(ImageView):
def __init__(self, *args, **kwargs):
if 'stream' in kwargs:
del kwargs['stream']
super(DynImageView, self).__init__(*args, **kwargs) The plugin continues to work in this case |
That should work for |
Notes: When instantiating the # TabView constructor for references
class TabView(QTabWidget):
def __init__(
self,
catalogmodel: QStandardItemModel = None,
selectionmodel: QItemSelectionModel = None,
widgetcls=None,
stream=None,
field=None,
bindings: List[tuple] = [],
**kwargs,
):
# ...
# tabview.py:89
newwidget = self.widgetcls(itemdata, stream=self.stream, field=self.field, **self.kwargs) If the Here are some design questions I have regarding this:
Example of this issue occurring for `NCEMViewerPlugin`, `FFTViewerPlugin`, `FourDImageView`.class NCEMPlugin(GUIPlugin):
# ....
def __init__(self):
# ....
self.rawview = TabView(self.headermodel, self.selectionmodel, widgets.NCEMViewerPlugin, 'primary')
self.fftview = TabView(self.headermodel, self.selectionmodel, widgets.FFTViewerPlugin, 'primary')
self.fourDview = TabView(self.headermodel, self.selectionmodel, widgets.FourDImageView, 'primary') class NCEMViewerPlugin(DynImageView, QWidgetPlugin):
def __init__(self, header: NonDBHeader = None, field: str = 'primary', toolbar: QToolBar = None, *args, **kwargs):
# ...
super(NCEMViewerPlugin, self).__init__(**kwargs) class DynImageView(ImageView):
def __init__(self, *args, **kwargs):
super(DynImageView, self).__init__(*args, **kwargs) class ImageView(QtGui.QtWidget):
def __init__(self, parent=None, name="ImageView", view=None, imageItem=None, *args): class QWidgetPlugin(QWidget, IPlugin):
isSingleton = False
# no __init__, implicit QWidget construction |
Use Splitter to make layout interactively configurable.
For now Im going to fix this in my plugins by adding |
This was reported by Peter Ercias. The xi-cam.NCEM plugin cannot instatiate because of the stream kwarg introduced in cea06d1.
When the DunImageView instantiates, it complains that stream is unexpected.
The text was updated successfully, but these errors were encountered: