mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
workaround for tag completion breakage on qt 4.5.1
This commit is contained in:
parent
4bfdc04ac0
commit
c608ed5e42
1 changed files with 11 additions and 0 deletions
|
@ -32,6 +32,17 @@ class TagEdit(QLineEdit):
|
|||
QLineEdit.focusOutEvent(self, evt)
|
||||
self.emit(SIGNAL("lostFocus"))
|
||||
|
||||
def keyPressEvent(self, evt):
|
||||
if evt.key() in (Qt.Key_Enter, Qt.Key_Return):
|
||||
evt.accept()
|
||||
if self.completer.completionCount():
|
||||
self.setText(
|
||||
self.completer.pathFromIndex(self.completer.popup().currentIndex()))
|
||||
else:
|
||||
self.setText(self.completer.completionPrefix())
|
||||
return
|
||||
QLineEdit.keyPressEvent(self, evt)
|
||||
|
||||
class TagCompleter(QCompleter):
|
||||
|
||||
def __init__(self, model, parent, edit, *args):
|
||||
|
|
Loading…
Reference in a new issue