add imageChange slot to inserters

This gets called every time the current image in the label tool changes
to make the inserter aware of this.
This commit is contained in:
Martin Baeuml
2011-09-14 15:42:56 +02:00
parent 65cdb2aaf2
commit 348643d67a
2 changed files with 8 additions and 0 deletions
+2
View File
@@ -115,6 +115,7 @@ class AnnotationScene(QGraphicsScene):
def onInserterFinished(self):
self.sender().inserterFinished.disconnect(self.onInserterFinished)
self._labeltool.currentImageChanged.disconnect(self.sender())
self._labeltool.exitInsertMode()
self._inserter = None
@@ -131,6 +132,7 @@ class AnnotationScene(QGraphicsScene):
if inserter is None:
raise InvalidArgumentException("Could not find inserter for class '%s' with default properties '%s'" % (label_class, default_properties))
inserter.inserterFinished.connect(self.onInserterFinished)
self._labeltool.currentImageChanged.connect(inserter.imageChange)
self._inserter = inserter
LOG.debug("Created inserter for class '%s' with default properties '%s'" % (label_class, default_properties))
+6
View File
@@ -28,6 +28,12 @@ class ItemInserter(QObject):
def keyPressEvent(self, event, image_item):
event.ignore()
def imageChange(self):
"""
Slot which gets called if the current image in the labeltool changes.
"""
pass
def allowOutOfSceneEvents(self):
return False