def getToolBars(self): if not hasattr(self, '_insertToolBar'): self._insertToolBar = QtGui.QToolBar('Insert') self._toolBars.append(self._insertToolBar) for action in self.insertMenu.actions(): button = MToolButton() button.setDefaultAction(action) self._insertToolBar.addWidget(button) return self._toolBars
def getToolBars(self): # Add specific tool items with respect to kkit if not hasattr(self, '_insertToolBar'): self._insertToolBar = QtGui.QToolBar('Insert') self._toolBars.append(self._insertToolBar) for action in self.insertMenu.actions(): button = MToolButton() button.setDefaultAction(action) # set the unicode instead of image by setting # button.setText(unicode(u'\u20de')) Iconpath = os.path.join(config.MOOSE_ICON_DIR) _logger.debug( "Reading icons from %s" % Iconpath ) button.setIcon( QtGui.QIcon( os.path.join(Iconpath, '%s' % action.text() + ".png") ) ) self._insertToolBar.addWidget(button) return self._toolBars