View Single Post
Old 02-02-2014, 10:28 PM   #3
kabirmaar
Member
kabirmaar began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Feb 2014
Device: none
Quote:
Originally Posted by kovidgoyal View Post
See setup_tool_button() in gui2/bars.py

Though I'm not clear why you need a reference to the button. Simply add your QWidgetAction to the qactions menu as you would normally.
hm. i was looking for a toolbar button as a reference because QWidgetAction asks for parent when created. and in the example above that parent is button on which action should be added.

when i do this in InterfaceAction.genesis (having action_add_menu = True):

Code:
self.qaction.menu().addAction(QWidgetAction().setDefaultWidget(d))
where d is QDialog instance in main.py (canonical plugin example) nothing happens. my guess was that QWidgetAction(plugin_toolbar_button).setDefaultWid get(d) will solve that problem. i could be easily wrong...

Last edited by kabirmaar; 02-02-2014 at 10:30 PM. Reason: formating
kabirmaar is offline   Reply With Quote