Skip to content

Commit 9a27269

Browse files
committed
Tutorial: Clean up tutorial objects
1 parent 937c87c commit 9a27269

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/windows/views/tutorial.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ def __init__(self, id, text, arrow, *args):
154154
# Make transparent
155155
self.setAttribute(Qt.WA_NoSystemBackground, True)
156156
self.setAttribute(Qt.WA_TranslucentBackground, True)
157-
#self.setWindowFlags(Qt.FramelessWindowHint)
157+
# self.setWindowFlags(Qt.FramelessWindowHint)
158+
159+
self.setAttribute(Qt.WA_DeleteOnClose, True)
158160

159161

160162
class TutorialManager(object):
@@ -197,6 +199,9 @@ def process(self, parent_name=None):
197199
tutorial_dialog.btn_next_tip.clicked.connect(functools.partial(self.next_tip, tutorial_id))
198200
tutorial_dialog.btn_close_tips.clicked.connect(functools.partial(self.hide_tips, tutorial_id, True))
199201

202+
# Get previous dock contents
203+
old_widget = self.dock.widget()
204+
200205
# Insert into tutorial dock
201206
self.dock.setWidget(tutorial_dialog)
202207
self.current_dialog = tutorial_dialog
@@ -206,6 +211,11 @@ def process(self, parent_name=None):
206211
self.dock.setEnabled(True)
207212
self.re_position_dialog()
208213
self.dock.show()
214+
215+
# Delete old widget
216+
if old_widget:
217+
old_widget.close()
218+
209219
break
210220

211221
def get_object(self, object_id):

0 commit comments

Comments
 (0)