Beispiel #1
0
 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)
Beispiel #2
0
 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)
Beispiel #3
0
 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)
Beispiel #4
0
 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)
Beispiel #5
0
 def keyPressEvent(self, ev):
     if handle_enter_press(self, ev):
         return
     return QTableView.keyPressEvent(self, ev)
Beispiel #6
0
 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)
Beispiel #7
0
 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)