Remove deleteLater calls that can be replaced by setParent(None)

This commit is contained in:
Veronica Berglyd Olsen
2025-01-22 00:35:53 +01:00
parent 5b840ada83
commit 49e3403d69
6 changed files with 9 additions and 4 deletions
+2 -1
View File
@@ -424,7 +424,8 @@ class GuiDocViewer(QTextBrowser):
# Open the context menu
if viewport := self.viewport():
ctxMenu.exec(viewport.mapToGlobal(point))
ctxMenu.deleteLater()
ctxMenu.setParent(None)
return
+2 -1
View File
@@ -969,7 +969,8 @@ class GuiProjectTree(QTreeView):
if viewport := self.viewport():
ctxMenu.exec(viewport.mapToGlobal(point))
ctxMenu.deleteLater()
ctxMenu.setParent(None)
return
+1 -1
View File
@@ -1064,7 +1064,7 @@ class GuiMain(QMainWindow):
if syntax:
SHARED.theme.loadSyntax()
self.docEditor.updateSyntaxColours()
self.docEditor.updateSyntaxColors()
self.docEditor.initEditor()
self.docViewer.initViewer()
+1 -1
View File
@@ -366,7 +366,7 @@ class _OpenProjectPage(QWidget):
action = qtAddAction(ctxMenu, self.tr("Remove Project"))
action.triggered.connect(self._deleteSelectedItem)
ctxMenu.exec(self.mapToGlobal(pos))
ctxMenu.deleteLater()
ctxMenu.setParent(None)
return
##