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 init(self): if hasattr(self, 'tree'): return self.tree = MooseTreeEditor() self.tree.setAcceptDrops(True) self.getTreeMenu() self._toolBars.append(QtGui.QToolBar('Insert')) for action in self.insertMenu.actions(): button = MToolButton() button.setDefaultAction(action) self._toolBars[-1].addWidget(button) self.layout().addWidget(self.tree)
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')) button.setIcon(QtGui.QIcon("~/../../Docs/images/classIcon/" + action.text() + ".png")) # button.setIconSize(QtCore.QSize(200,200)) self._insertToolBar.addWidget(button) return self._toolBars
def __init__(self, *args): DefaultEditorWidget.__init__(self, *args) self.setAcceptDrops(True) self.border = 10 self.sceneContainer = QtGui.QGraphicsScene(self) self.sceneContainer.setSceneRect(self.sceneContainer.itemsBoundingRect()) self.sceneContainer.setBackgroundBrush(QtGui.QColor(230,220,219,120)) self.insertMenu = QtGui.QMenu('&Insert') self._menus.append(self.insertMenu) self._toolBars.append(QtGui.QToolBar('Insert')) self.insertMapper = QtCore.QSignalMapper(self) classlist = ['CubeMesh','CylMesh','Pool','FuncPool','SumFunc','Reac','Enz','MMenz','StimulusTable','Table'] insertMapper, actions = self.getInsertActions(classlist) for action in actions: self.insertMenu.addAction(action) for action in self.insertMenu.actions(): #self._toolBars[-1].addAction(action) button = MToolButton() button.setDefaultAction(action) self._toolBars[-1].addWidget(button)
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')) button.setIcon( QtGui.QIcon("~/../../Docs/images/classIcon/" + action.text() + ".png")) #button.setIconSize(QtCore.QSize(200,200)) self._insertToolBar.addWidget(button) return self._toolBars