From 7816fd3d3a771cac60a7de9cde8914cf634354aa Mon Sep 17 00:00:00 2001 From: Genevieve Buckley <30920819+GenevieveBuckley@users.noreply.github.com> Date: Wed, 5 Jul 2023 10:12:47 +1000 Subject: [PATCH] DOCS: Widget guide should consistently use parent=None kwarg in examples (#302) Closes https://github.com/napari/docs/issues/186 and prevents leaking widgets in cases where widgets remain floating (undocked) Co-authored-by: Talley Lambert --- _docs/templates/_npe2_widgets_guide.md.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_docs/templates/_npe2_widgets_guide.md.jinja b/_docs/templates/_npe2_widgets_guide.md.jinja index 4e867ee7..5aea415f 100644 --- a/_docs/templates/_npe2_widgets_guide.md.jinja +++ b/_docs/templates/_npe2_widgets_guide.md.jinja @@ -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 ```