Re: [Qgis-user] Looking for QGIS Python code for a three-level menu?

2024-05-12 Thread Raymond Nijssen via QGIS-User
Wow, this is so much more logical! If this works, then why do we (still) have the addPluginToMenu() available? Raymond On 12-05-2024 22:26, Jürgen E. Fischer via QGIS-User wrote: Hi Mike, On Sun, 12. May 2024 at 17:35:14 +, Elstermann, Mike via QGIS-User wrote: I'm looking for a piece

Re: [Qgis-user] Looking for QGIS Python code for a three-level menu?

2024-05-12 Thread Jürgen E . Fischer via QGIS-User
Hi Mike, On Sun, 12. May 2024 at 17:35:14 +, Elstermann, Mike via QGIS-User wrote: > I'm looking for a piece of QGIS Python code for a three-level menu, something > like this: > > Plugins >| >| > MyMenu > -+-- Submenu 1 > SubSubMenu 1.1 >| | +---

Re: [Qgis-user] Looking for QGIS Python code for a three-level menu?

2024-05-12 Thread Raymond Nijssen via QGIS-User
Hi Mike, I'm afraid you cannot add submenus to the plugin menu. The addPluginToMenu function only takes actions as an argument: action_1 = QAction('Action 1') iface.addPluginToMenu('Plugin 1', action_1) menu_1 = QMenu('Menu 1') iface.addPluginToMenu('Plugin 1', menu_1) The last line

[Qgis-user] Looking for QGIS Python code for a three-level menu?

2024-05-12 Thread Elstermann, Mike via QGIS-User
Hello everyone, I'm looking for a piece of QGIS Python code for a three-level menu, something like this: Plugins | | MyMenu > -+-- Submenu 1 > SubSubMenu 1.1 | | +--- SubSubMenu 1.2 | | +--- SubSubMenu 1.3 Other... | +-- Submenu