Recently I began exploring developing UI in Qt Designer and editing them through PyQt. Things have been going pretty smoothy, but I'm currently stuck trying to solve the following issue:
I've inserted a MatplotLib widget through Qt Designer and managed to plot pretty well horizontal bars using barh. Next I tried and successfully managed to insert a functional NavigationToolBar through matplotlib.backends.backend_qt4agg.NavigationToolbar2QT
Then, following this thread (and similar ones) I managed to edit which buttons I would like to display on the toolbar... How to modify the navigation toolbar easily in a matplotlib figure window?
It works well for every button except for the last one, with a check box drawing which description "Edit curves line and axes parameters". In this particular case, I would really like to remove this button, because it constantly resizes the plot when moving the mouse and in this case I don't need this button.
I haven't found yet any thread discussing this particular toolbar button (just this one matplotlib: Qt4Agg toolbar's irritating bug)
The code used to insert the toolbar and currently edit buttons looks something like this:
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT
class currentUI(QtGui.QWidget):
def __init__(self):
super(currentUI,self).__init__()
(...)
uic.loadUi('portfolioManager.ui',self)
self.initUI()
(...)
def initUI(self):
self.setWidgetsPropertiesAndActions()
(...)
def setWidgetsPropertiesAndActions(self):
(...)
self.navi_toolbar=NavigationToolbar(self.mplwidgetExposures, self)
self.LayoutPlot.addWidget(self.navi_toolbar)
(...)
class NavigationToolbar(NavigationToolbar2QT):
toolitems = [t for t in NavigationToolbar2QT.toolitems if
t[0] in ('Home','Pan', 'Zoom', 'Save','Subplots')]
This successfully embeds the toolbar, but the "edit" button remains.
Thanks very much for any insight. Regards