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

AmFreak at web.de AmFreak at web.de
Thu Jul 15 03:11:11 BST 2010


Hi,

im trying to add a Submenu to a Context Menu of my Plasmoid - but i'm
failing.
Below is the Code for adding 2 Items to the Context Menu:

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.


More information about the PyQt mailing list