mirror of
https://github.com/GNS3/gns3-gui.git
synced 2026-05-17 00:46:01 +03:00
Fix QMenu parents
This commit is contained in:
@@ -322,7 +322,7 @@ class LinkItem(QtWidgets.QGraphicsPathItem):
|
||||
# create the contextual menu
|
||||
self.setHovered(True)
|
||||
self.setAcceptHoverEvents(False)
|
||||
menu = QtWidgets.QMenu(parent=self)
|
||||
menu = QtWidgets.QMenu(parent=self.scene().parent())
|
||||
self.populateLinkContextualMenu(menu)
|
||||
menu.exec(QtGui.QCursor.pos())
|
||||
self.setAcceptHoverEvents(True)
|
||||
|
||||
@@ -402,7 +402,7 @@ class NodeItem(QtSvgWidgets.QGraphicsSvgItem):
|
||||
"""
|
||||
|
||||
self._selected_port = None
|
||||
menu = QtWidgets.QMenu(parent=self)
|
||||
menu = QtWidgets.QMenu(parent=self.scene().parent())
|
||||
ports = self._node.ports()
|
||||
if not ports:
|
||||
QtWidgets.QMessageBox.critical(self.scene().parent(), "Link", "No port available, please configure this device")
|
||||
|
||||
Reference in New Issue
Block a user