workaround for tag completion breakage on qt 4.5.1

This commit is contained in:
Damien Elmes 2009-04-30 05:13:26 +09:00
parent 4bfdc04ac0
commit c608ed5e42

View file

@ -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):