Class: QgsDataItemGuiProviderUtils

Utility functions for QgsDataItemGuiProviders.

Added in version 3.38.

Static Methods

addToSubMenu

Add an actionToAdd to the sub menu with subMenuName in mainMenu.

class qgis.gui.QgsDataItemGuiProviderUtils[source]

Bases: object

static addToSubMenu(mainMenu: QMenu | None, actionToAdd: QAction | None, subMenuName: str | None)[source]

Add an actionToAdd to the sub menu with subMenuName in mainMenu. If the sub menu with given name does not exist it will be created.

Parameters:
  • mainMenu (Optional[QMenu]) – The menu in which sub menu is search for or created.

  • actionToAdd (Optional[QAction]) – The action to add.

  • subMenuName (Optional[str]) – Translated name of the sub menu that is searched for or created.

Added in version 4.0.