From 0c85aed04adf1ab78f61bcd1f6e609850011de48 Mon Sep 17 00:00:00 2001 From: Glutanimate Date: Wed, 30 Aug 2017 12:49:04 +0200 Subject: [PATCH] Navigate through tag autocompletions with Ctrl+Tab --- aqt/tagedit.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aqt/tagedit.py b/aqt/tagedit.py index 85c83cb9e..e6a6d9c07 100644 --- a/aqt/tagedit.py +++ b/aqt/tagedit.py @@ -36,6 +36,16 @@ class TagEdit(QLineEdit): self.showCompleter() def keyPressEvent(self, evt): + if (evt.key() == Qt.Key_Tab and evt.modifiers() & Qt.ControlModifier): + if not self.completer.popup().isVisible(): + self.showCompleter() + # select next completion + index = self.completer.currentIndex() + self.completer.popup().setCurrentIndex(index) + cur_row = index.row() + if not self.completer.setCurrentRow(cur_row + 1): + self.completer.setCurrentRow(0) + return if evt.key() in (Qt.Key_Enter, Qt.Key_Return): self.hideCompleter() QWidget.keyPressEvent(self, evt)