Exemplo n.º 1
0
 def _listKeyPressEvent(self, event):
     if event.matches(QKeySequence.Delete):
         self._deleteList()
     elif event.key() == Qt.Key_Escape:
         self.playlistList.setCurrentIndex(QModelIndex())
     else:
         QListView.keyPressEvent(self.playlistList, event)
Exemplo n.º 2
0
 def keyPressEvent(self, event):
     if event.matches(QKeySequence.Delete):
         self._removeSelected()
     elif event.key() == Qt.Key_Escape:
         self.currentList.reset()
     else:
         QListView.keyPressEvent(self.currentList, event)
Exemplo n.º 3
0
 def keyPressEvent(self, evt):
     """
     Protected method implementing special key handling.
     
     @param evt reference to the event (QKeyEvent)
     """
     if evt.key() in [Qt.Key_Delete, Qt.Key_Backspace] and \
        self.model() is not None:
         self.removeSelected()
         evt.setAccepted(True)
     else:
         QListView.keyPressEvent(self, evt)