View Single Post
Old 02-02-2014, 11:09 PM   #5
kabirmaar
Member
kabirmaar began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Feb 2014
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Set the menu as the parent. And keep a python reference to the widget action to prevent it from being garbage collected.
thanx. works!

had to add QMenu(self.gui) to qaction and keep a python reference to the widget action...

Code:
d = MyPlugin(self.gui, self.qaction.icon(), do_user_config, self.qaction)
m = QMenu(self.gui)
self.qaction.setMenu(m)
a = QWidgetAction(m)
a.setDefaultWidget(d)
m.addAction(a)
kabirmaar is offline   Reply With Quote