Make sure all QMenu instances have a parent widget set (#1536)
This commit is contained in:
@@ -1121,7 +1121,7 @@ class GuiDocEditor(QTextEdit):
|
|||||||
userSelection = userCursor.hasSelection()
|
userSelection = userCursor.hasSelection()
|
||||||
posCursor = self.cursorForPosition(thePos)
|
posCursor = self.cursorForPosition(thePos)
|
||||||
|
|
||||||
mnuContext = QMenu()
|
mnuContext = QMenu(self)
|
||||||
|
|
||||||
# Follow, Cut, Copy and Paste
|
# Follow, Cut, Copy and Paste
|
||||||
# ===========================
|
# ===========================
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ class GuiDocViewer(QTextBrowser):
|
|||||||
userCursor = self.textCursor()
|
userCursor = self.textCursor()
|
||||||
userSelection = userCursor.hasSelection()
|
userSelection = userCursor.hasSelection()
|
||||||
|
|
||||||
mnuContext = QMenu()
|
mnuContext = QMenu(self)
|
||||||
|
|
||||||
# Cut, Copy and Paste
|
# Cut, Copy and Paste
|
||||||
# ===================
|
# ===================
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ class GuiNovelToolBar(QWidget):
|
|||||||
self.tbRefresh.clicked.connect(self._refreshNovelTree)
|
self.tbRefresh.clicked.connect(self._refreshNovelTree)
|
||||||
|
|
||||||
# More Options Menu
|
# More Options Menu
|
||||||
self.mMore = QMenu()
|
self.mMore = QMenu(self)
|
||||||
|
|
||||||
self.mLastCol = self.mMore.addMenu(self.tr("Last Column"))
|
self.mLastCol = self.mMore.addMenu(self.tr("Last Column"))
|
||||||
self.gLastCol = QActionGroup(self.mMore)
|
self.gLastCol = QActionGroup(self.mMore)
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ class GuiProjectToolBar(QWidget):
|
|||||||
self.viewLabel.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
|
self.viewLabel.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
|
||||||
|
|
||||||
# Quick Links
|
# Quick Links
|
||||||
self.mQuick = QMenu()
|
self.mQuick = QMenu(self)
|
||||||
|
|
||||||
self.tbQuick = QToolButton(self)
|
self.tbQuick = QToolButton(self)
|
||||||
self.tbQuick.setToolTip("%s [Ctrl+L]" % self.tr("Quick Links"))
|
self.tbQuick.setToolTip("%s [Ctrl+L]" % self.tr("Quick Links"))
|
||||||
@@ -269,7 +269,7 @@ class GuiProjectToolBar(QWidget):
|
|||||||
self.tbMoveD.clicked.connect(lambda: self.projTree.moveTreeItem(1))
|
self.tbMoveD.clicked.connect(lambda: self.projTree.moveTreeItem(1))
|
||||||
|
|
||||||
# Add Item Menu
|
# Add Item Menu
|
||||||
self.mAdd = QMenu()
|
self.mAdd = QMenu(self)
|
||||||
|
|
||||||
self.aAddEmpty = self.mAdd.addAction(trConst(nwLabels.ITEM_DESCRIPTION["document"]))
|
self.aAddEmpty = self.mAdd.addAction(trConst(nwLabels.ITEM_DESCRIPTION["document"]))
|
||||||
self.aAddEmpty.triggered.connect(
|
self.aAddEmpty.triggered.connect(
|
||||||
@@ -307,7 +307,7 @@ class GuiProjectToolBar(QWidget):
|
|||||||
self.tbAdd.setPopupMode(QToolButton.InstantPopup)
|
self.tbAdd.setPopupMode(QToolButton.InstantPopup)
|
||||||
|
|
||||||
# More Options Menu
|
# More Options Menu
|
||||||
self.mMore = QMenu()
|
self.mMore = QMenu(self)
|
||||||
|
|
||||||
self.aExpand = self.mMore.addAction(self.tr("Expand All"))
|
self.aExpand = self.mMore.addAction(self.tr("Expand All"))
|
||||||
self.aExpand.triggered.connect(lambda: self.projTree.setExpandedFromHandle(None, True))
|
self.aExpand.triggered.connect(lambda: self.projTree.setExpandedFromHandle(None, True))
|
||||||
@@ -1210,7 +1210,7 @@ class GuiProjectTree(QTreeWidget):
|
|||||||
logger.debug("No item found")
|
logger.debug("No item found")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
ctxMenu = QMenu()
|
ctxMenu = QMenu(self)
|
||||||
|
|
||||||
# Trash Folder
|
# Trash Folder
|
||||||
# ============
|
# ============
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class GuiSideBar(QToolBar):
|
|||||||
self.aStats.triggered.connect(lambda: self.mainGui.showWritingStatsDialog())
|
self.aStats.triggered.connect(lambda: self.mainGui.showWritingStatsDialog())
|
||||||
|
|
||||||
# Settings Menu
|
# Settings Menu
|
||||||
self.mSettings = QMenu()
|
self.mSettings = QMenu(self)
|
||||||
|
|
||||||
self.mSettings.addAction(self.mainGui.mainMenu.aEditWordList)
|
self.mSettings.addAction(self.mainGui.mainMenu.aEditWordList)
|
||||||
self.mSettings.addAction(self.mainGui.mainMenu.aProjectSettings)
|
self.mSettings.addAction(self.mainGui.mainMenu.aProjectSettings)
|
||||||
|
|||||||
@@ -720,7 +720,7 @@ class _HeadingsTab(QWidget):
|
|||||||
|
|
||||||
self.formSyntax = _HeadingSyntaxHighlighter(self.editTextBox.document())
|
self.formSyntax = _HeadingSyntaxHighlighter(self.editTextBox.document())
|
||||||
|
|
||||||
self.menuInsert = QMenu()
|
self.menuInsert = QMenu(self)
|
||||||
self.aInsTitle = self.menuInsert.addAction(self.tr("Title"))
|
self.aInsTitle = self.menuInsert.addAction(self.tr("Title"))
|
||||||
self.aInsChNum = self.menuInsert.addAction(self.tr("Chapter Number"))
|
self.aInsChNum = self.menuInsert.addAction(self.tr("Chapter Number"))
|
||||||
self.aInsChWord = self.menuInsert.addAction(self.tr("Chapter Number (Word)"))
|
self.aInsChWord = self.menuInsert.addAction(self.tr("Chapter Number (Word)"))
|
||||||
|
|||||||
Reference in New Issue
Block a user