mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
remove old keypress handler; qt seems to get it right now
This commit is contained in:
parent
9344b7da79
commit
0c7988fc01
1 changed files with 0 additions and 19 deletions
|
@ -34,25 +34,6 @@ 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):
|
||||
oldtxt = self.text()
|
||||
if not self.text():
|
||||
evt.ignore()
|
||||
else:
|
||||
if self.completer.completionCount():
|
||||
self.setText(
|
||||
self.completer.pathFromIndex(self.completer.popup().currentIndex()))
|
||||
else:
|
||||
self.setText(self.completer.completionPrefix())
|
||||
if self.text() == oldtxt:
|
||||
evt.ignore()
|
||||
else:
|
||||
evt.accept()
|
||||
self.completer.popup().hide()
|
||||
return
|
||||
QLineEdit.keyPressEvent(self, evt)
|
||||
|
||||
class TagCompleter(QCompleter):
|
||||
|
||||
def __init__(self, model, parent, edit, *args):
|
||||
|
|
Loading…
Reference in a new issue