mirror of
https://github.com/ankitects/anki.git
synced 2025-11-14 16:47:12 -05: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)
|
QLineEdit.focusOutEvent(self, evt)
|
||||||
self.emit(SIGNAL("lostFocus"))
|
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):
|
class TagCompleter(QCompleter):
|
||||||
|
|
||||||
def __init__(self, model, parent, edit, *args):
|
def __init__(self, model, parent, edit, *args):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue