I have a QToolButton that I want to add to an existing toolbar. Using the Python Console in QGIS 2.14.12 to debug, here's the code fragment that I'm having a problems with:
iface.toolButton=QToolButton() iface.toolButton.setIcon(QIcon("C:/Users/Rudy/.qgis2/python/plugins/sandbox/icons/action1.png")) iface.addToolBarWidget(iface.toolButton)
The toolButton displays in the Plugins toolbar, just like the documentation for addToolBarWidget says :-). However, I want it to display in another existing toolbar, not the Plugins toolbar. There is the addUserInputWidget call, but all that happens when I use that call is that a user input box flashes momentarily on the screen, then disappears. The result is that the toolButton doesn't show up anywhere. Isn't there an API call that would place widgets in any toolbar that I specify?