From aecd3ee17f5fd22a6d9180644a7341ae26b9d2cf Mon Sep 17 00:00:00 2001 From: Mika Fischer Date: Wed, 15 Jun 2011 11:48:37 +0200 Subject: [PATCH] Always have a valid model in LabelTool --- sloth/core/labeltool.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sloth/core/labeltool.py b/sloth/core/labeltool.py index 47fdb11..e880c88 100755 --- a/sloth/core/labeltool.py +++ b/sloth/core/labeltool.py @@ -65,7 +65,7 @@ class LabelTool(QObject): self.container_factory_ = None self.container_ = AnnotationContainer() self._current_image = None - self._model = None + self._model = AnnotationModel([]) def main_help_text(self): """ @@ -234,8 +234,7 @@ class LabelTool(QObject): return success def clearAnnotations(self): - self.container_.clear() - self._model = AnnotationModel(self.container_.annotations()) + self._model = AnnotationModel([]) #self._model.setBasedir("") self.statusMessage.emit('') self.annotationsLoaded.emit()