i would like to make plugin with drop-down menu (self.popup_type = QToolButton.InstantPopup) and instead of textual (q)action i would like to add custom QWidget.
i have separated code which looks like this:
Code:
class Window(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)
layout = QtGui.QHBoxLayout(self)
self.button = QtGui.QToolButton(self)
self.button.setPopupMode(QtGui.QToolButton.InstantPopup)
self.button.setMenu(QtGui.QMenu(self.button))
self.textBox = QtGui.QTextBrowser(self)
action = QtGui.QWidgetAction(self.button)
action.setDefaultWidget(self.textBox)
self.button.menu().addAction(action)
layout.addWidget(self.button)
if __name__ == '__main__':
import sys
app = QtGui.QApplication(sys.argv)
window = Window()
window.resize(100, 60)
window.show()
sys.exit(app.exec_())
i can't find the reference to plugin's toolbar button in calibre which i would use as equivalent to self.button (as above).
in calibre plugin development i tried things like: self.qaction.parentWidget() and few others (but rather would avoid showing it

)
no luck.
any idea how to do that?