def initToolbar(self): self.timeText = QtGui.QLabel('Time: 0.0000', self) self.prefix = QtGui.QLineEdit('', self) self.postfix = QtGui.QLineEdit('', self) # Update self.toolbar_actions # "list[x:x] += list2" is Python idiom for add list to the another list my_toolbar_actions = [self.timeText, None] self.toolbar_actions[4:4] += my_toolbar_actions # Call the parent function to initialize the toolbar PyDartQtWindow.initToolbar(self)
def initToolbar(self): # Print self.toolbar_actions (initialized from the parent) for i, action in enumerate(self.toolbar_actions): # If action is none, it will become a separator if action is not None: print i, action.text() # Update self.toolbar_actions # "list[x:x] += list2" is Python idiom for add list to the another list my_toolbar_actions = [self.printAction, None] self.toolbar_actions[4:4] += my_toolbar_actions # Call the parent function to initialize the toolbar PyDartQtWindow.initToolbar(self)
def initMenu(self): PyDartQtWindow.initMenu(self) self.fileMenu.addAction(self.loadAction) self.fileMenu.addAction(self.saveAction)
def initActions(self): PyDartQtWindow.initActions(self) self.loadAction = self.createAction('Load', self.printEvent) self.saveAction = self.createAction('Save', self.saveEvent) self.printAction = self.createAction('Print', self.printEvent)
def idleTimerEvent(self): PyDartQtWindow.idleTimerEvent(self) self.timeText.setText('T: %.4f' % self.sim.world.t)
def initMenu(self): PyDartQtWindow.initMenu(self) # self.fileMenu.addAction(self.loadAction) # self.fileMenu.addAction(self.saveAction) self.fileMenu.addAction(self.exportAction)
def initActions(self): PyDartQtWindow.initActions(self) self.exportAction = self.createAction('&Export', self.exportEvent)