def pastecell(self): """ Kopiert Wert in eine ausgewaehlte Zelle :return: """ clipboard = QApplication.clipboard() index = self.gui.tableView.selectionModel().selectedIndexes()[0] command = EditCommand(self.tablemodel, index) command.newValue(str(clipboard.text())) self.undoStack.push(command) self.gui.tableView.reset()
def cutcell(self): """ Schneidet eine Zelle aus :return: """ self.copycell() index = self.gui.tableView.selectionModel().selectedIndexes()[0] command = EditCommand(self.tablemodel, index) command.newValue("") self.undoStack.beginMacro("Cut") self.undoStack.push(command) self.undoStack.endMacro() self.undoText_redoText() self.gui.tableView.reset()
def editorEvent(self, event, model, option, index): self.edit = EditCommand(model, index)