allow setting id during insert mode

This commit is contained in:
Martin Baeuml
2011-10-12 12:56:35 +02:00
parent 09060a52fc
commit 76bc73440c
+8
View File
@@ -258,6 +258,14 @@ class BBoxFaceInserter(SequenceItemInserter):
def keyPressEvent(self, event, image_item):
if event.key() == Qt.Key_O and self._state > 0:
self.toggleOccludedForCurrentInserter()
return
elif Qt.Key_0 <= event.key() <= Qt.Key_9:
self._ann['id'] = int(str(event.text()))
message = self._scene._message
if message is None:
message = ""
self._scene.setMessage(message + "\nSet id to %d." % self._ann['id'])
return
SequenceItemInserter.keyPressEvent(self, event, image_item)
def imageChange(self):