Quote:
Originally Posted by kovidgoyal
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...