[Qgis-user] Looking for QGIS Python code for a three-level menu?
Raymond Nijssen
r.nijssen at terglobo.nl
Sun May 12 22:17:40 PDT 2024
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 +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
>
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
More information about the QGIS-User
mailing list