markfinal / cruiz

Conan recipe user interface
https://cruiz.readthedocs.io/
Apache License 2.0
11 stars 1 forks source link

Custom context menus are overwritten #81

Closed markfinal closed 1 year ago

markfinal commented 1 year ago

This is a regression from the fix for #46

There are three places where a custom context menu is shown:

Local cache

What happens is that the procedural submenu now overwrites the parent menu.

The statement in question that was added in the previous fix is

    def contextMenuEvent(self, event: QtGui.QContextMenuEvent) -> None:
        menu = self.createStandardContextMenu()
        if self._custom_menu:
            menu.addSeparator()
            self._custom_menu.setParent(menu) <-- this
            menu.addMenu(self._custom_menu)
        menu.exec_(event.globalPos())

which if removed does resolve the problem, but this was added to resolve warnings on Linux.