From 0c76ddeb99831f490cfa6d1a5d0f43eb8c3e1332 Mon Sep 17 00:00:00 2001 From: Martin Baeuml Date: Tue, 17 May 2011 15:42:21 +0200 Subject: [PATCH] forward keyboard events to scene after selecting item with Tab --- sloth/gui/annotationscene.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sloth/gui/annotationscene.py b/sloth/gui/annotationscene.py index a38104a..db8b479 100644 --- a/sloth/gui/annotationscene.py +++ b/sloth/gui/annotationscene.py @@ -172,8 +172,14 @@ class AnnotationScene(QGraphicsScene): # key event handlers #______________________________________________________________________________________________________ def selectNextItem(self): + # disable inserting + # TODO: forward this to the ButtonArea self.inserter_ = None + # set focus to the view, so that subsequent keyboard events are forwarded to the scene + if len(self.views()) > 0: + self.views()[0].setFocus(True) + if len(self.selectedItems()) == 0: for item in self.items(): if (item.flags() & QGraphicsItem.ItemIsSelectable):