def keyPressEvent(self, ev): if ev.key() in (Qt.Key_Enter, Qt.Key_Return) and self.state() != self.EditingState: ci = self.currentIndex() if ci.isValid() and ci.flags() & Qt.ItemIsEditable: if self.edit(ci, self.EditKeyPressed, ev): ev.accept() return return QTableView.keyPressEvent(self, ev)
def keyPressEvent(self, ev): if ev.key() in (Qt.Key_Left, Qt.Key_Right): ac = self.MoveDown if ev.key() == Qt.Key_Right else self.MoveUp index = self.moveCursor(ac, ev.modifiers()) if index.isValid() and index != self.currentIndex(): m = self.selectionModel() m.select(index, m.Select | m.Current | m.Rows) self.setCurrentIndex(index) ev.accept() return return QTableView.keyPressEvent(self, ev)
def keyPressEvent(self, ev): if ev.key() in (Qt.Key_Left, Qt.Key_Right): ac = self.MoveDown if ev.key() == Qt.Key_Right else self.MoveUp index = self.moveCursor(ac, ev.modifiers()) if index.isValid() and index != self.currentIndex(): m = self.selectionModel() m.select(index, m.Select|m.Current|m.Rows) self.setCurrentIndex(index) ev.accept() return return QTableView.keyPressEvent(self, ev)
def keyPressEvent(self, ev): if handle_enter_press(self, ev): return return QTableView.keyPressEvent(self, ev)
def keyPressEvent(self, ev): if self.DELETE_POSSIBLE and ev.key() == Qt.Key_Delete: self.delete_selected() ev.accept() return return QTableView.keyPressEvent(self, ev)