Skip to content
Permalink
Browse files

fix vector menu creation on qt5

  • Loading branch information
jef-n committed Mar 19, 2016
1 parent 71429be commit a17ed10b65aff53e1e816757c3a75369898d5787
Showing with 9 additions and 12 deletions.
  1. +9 −12 python/plugins/processing/gui/menus.py
@@ -1,6 +1,6 @@
from processing.core.Processing import Processing
from processing.core.ProcessingConfig import ProcessingConfig, Setting
from PyQt4.QtGui import QAction, QMenu
from PyQt.QtWidgets import QAction, QMenu
from processing.gui.MessageDialog import MessageDialog
from processing.gui.AlgorithmDialog import AlgorithmDialog
from qgis.utils import iface
@@ -117,17 +117,17 @@ def updateMenus():


def createMenus():
for provider in Processing.algs.values():
for alg in provider.values():
for provider in list(Processing.algs.values()):
for alg in list(provider.values()):
menuPath = ProcessingConfig.getSetting("MENU_" + alg.commandLineName())
if menuPath:
paths = menuPath.split("/")
addAlgorithmEntry(alg, paths[0], paths[-1])


def removeMenus():
for provider in Processing.algs.values():
for alg in provider.values():
for provider in list(Processing.algs.values()):
for alg in list(provider.values()):
menuPath = ProcessingConfig.getSetting("MENU_" + alg.commandLineName())
if menuPath:
paths = menuPath.split("/")
@@ -196,14 +196,11 @@ def _executeAlgorithm(alg):


def getMenu(name, parent):
menus = [c for c in parent.children() if isinstance(c, QMenu)]
menusDict = {m.title(): m for m in menus}
if name in menusDict:
return menusDict[name]
menus = [c for c in parent.children() if isinstance(c, QMenu) and c.title() == name]
if menus:
return menus[0]
else:
menu = QMenu(name, parent)
parent.addMenu(menu)
return menu
return parent.addMenu(name)


def findAction(actions, alg, actionText=None):

0 comments on commit a17ed10

Please sign in to comment.
You can’t perform that action at this time.