mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-21 12:50:27 +08:00
ENH: Change inplace-add to normal add to support alternate syntax
Widgets can be added to Plugins inline, and Plugins can be added inline to Viewers.
This commit is contained in:
@@ -110,7 +110,7 @@ class Plugin(QtGui.QDialog):
|
||||
self.layout.addWidget(widget, self.row, 0)
|
||||
self.row += 1
|
||||
|
||||
def __iadd__(self, widget):
|
||||
def __add__(self, widget):
|
||||
self.add_widget(widget)
|
||||
return self
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ class ImageViewer(QtGui.QMainWindow):
|
||||
|
||||
self.connect_event('motion_notify_event', self.update_status_bar)
|
||||
|
||||
def __iadd__(self, plugin):
|
||||
def __add__(self, plugin):
|
||||
plugin.attach(self)
|
||||
return self
|
||||
|
||||
|
||||
Reference in New Issue
Block a user