Skip to content

Commit

Permalink
DOCS: Widget guide should consistently use parent=None kwarg in examp…
Browse files Browse the repository at this point in the history
…les (#302)

Closes napari/docs#186 and prevents leaking
widgets in cases where widgets remain floating (undocked)

Co-authored-by: Talley Lambert <talley.lambert@gmail.com>
  • Loading branch information
GenevieveBuckley and tlambert03 authored Jul 5, 2023
1 parent bcfed99 commit 7816fd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _docs/templates/_npe2_widgets_guide.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ specification:
from qtpy.QtWidgets import QWidget

class MyPluginWidget(QWidget):
def __init__(self, viewer: 'napari.viewer.Viewer'):
super().__init__()
def __init__(self, viewer: 'napari.viewer.Viewer', parent=None):
super().__init__(parent)
self._viewer = viewer
```

Expand Down

0 comments on commit 7816fd3

Please sign in to comment.