when enter hit, close completer and don't complete (#763)

This commit is contained in:
Damien Elmes 2013-05-22 12:03:30 +09:00
parent eb3df9a067
commit 30507d9e29

View File

@ -34,6 +34,9 @@ class TagEdit(QLineEdit):
self.showCompleter() self.showCompleter()
def keyPressEvent(self, evt): def keyPressEvent(self, evt):
if evt.key() in (Qt.Key_Enter, Qt.Key_Return):
self.hideCompleter()
return
QLineEdit.keyPressEvent(self, evt) QLineEdit.keyPressEvent(self, evt)
if not evt.text(): if not evt.text():
# if it's a modifier, don't show # if it's a modifier, don't show