[Qgis-user] Looking for QGIS Python code for a three-level menu?
Jürgen E. Fischer
jef at norbit.de
Sun May 12 13:26:06 PDT 2024
Hi Mike,
On Sun, 12. May 2024 at 17:35:14 +0000, 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
> | | +--- SubSubMenu 1.2
> | | +--- SubSubMenu 1.3
> Other... |
> +-- Submenu 2 > ---- SubSubMenu 2.1
> | +--- SubSubMenu 2.2
> | +--- SubSubMenu 2.3
> | +--- SubSubMenu 2.4
> |
> +-- Submenu 3 > ---- SubSubMenu 3.1
> +--- SubSubMenu 3.2
m0 = iface.pluginMenu().addMenu("MyMenu")
m1 = m0.addMenu("SubMenu 1")
m1.addMenu("SubSubMenu 1.1")
m1.addMenu("SubSubMenu 1.2")
m1.addMenu("SubSubMenu 1.3")
m1 = m0.addMenu("SubMenu 2")
m1.addMenu("SubSubMenu 2.1")
m1.addMenu("SubSubMenu 2.2")
m1.addMenu("SubSubMenu 2.3")
m1 = m0.addMenu("SubMenu 3")
m1.addMenu("SubSubMenu 3.1")
m1.addMenu("SubSubMenu 3.2")
Jürgen
--
Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-31
Dipl.-Inf. (FH) Rheinstraße 13 Fax. +49-4931-918175-50
Software Engineer D-26506 Norden https://www.norbit.de
QGIS release manager (PSC) Germany IRC: jef on Libera|OFTC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240512/65eb4ecf/attachment.sig>
More information about the QGIS-User
mailing list