Skip to content

Commit

Permalink
Fix duplicate items in menubar
Browse files Browse the repository at this point in the history
* When recreating the Results window, the menubar had duplicate items added each time.
* Removing the underlying C++ object is apparently enough to fix the issue.
* SetParent(None) can still be used in case of floating windows
  • Loading branch information
glubsy committed Aug 31, 2020
1 parent 4a1641e commit 584e9c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ def create_results_window(self):
self.details_dialog.setParent(None)
if self.resultWindow is not None:
self.resultWindow.close()
self.resultWindow.setParent(None)
# This is better for tabs, as it takes care of duplicate items in menu bar
self.resultWindow.deleteLater() if self.use_tabs else self.resultWindow.setParent(None)
if self.use_tabs:
self.resultWindow = self.main_window.createPage(
"ResultWindow", parent=self.main_window, app=self)
Expand Down

0 comments on commit 584e9c9

Please sign in to comment.