This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[Python] Adding a Submenu to a Context Menu of a Plasmoid

Tags: None
(comma "," separated)
Biene_Maja
Registered Member
Posts
2
Karma
0
Hi,

im trying to add a Submenu to a Context Menu of my Plasmoid - but failing.
Below is the Code for adding 2 Items to the Context Menu:
Code: Select all
 def contextualActions(self):             
        menu=[]
        a = QAction(KIcon(self.package().path() + "contents/icons/show.svg"), "item1", self)
        b = QAction(KIcon(self.package().path() + "contents/icons/show.svg"), "item2", self)
        menu.append(a)           
        menu.append(b)
 
        return menu


but how can i add a Submenu so that one item in the menu is a menu in itself ?

Thanks for any help in advance.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You may wish to look at KActionMenu.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
Biene_Maja
Registered Member
Posts
2
Karma
0
Just wanted to say thanks - that was what i was searching for ;D


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]