mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 22:14:07 +02:00
Workaround for Qt 5 bug that causes the incorrect item to be selected when pressing the Enter key in the completion popup for search boxes.
https://bugreports.qt-project.org/browse/QTBUG-40807
This commit is contained in:
parent
a59f657a69
commit
2a744a4cf9
1 changed files with 4 additions and 3 deletions
|
|
@ -85,10 +85,10 @@ def __init__(self, parent=None):
|
|||
c = self.line_edit.completer()
|
||||
c.setCompletionMode(c.PopupCompletion)
|
||||
c.highlighted[str].connect(self.completer_used)
|
||||
c.activated[str].connect(self.history_selected)
|
||||
|
||||
self.line_edit.key_pressed.connect(self.key_pressed, type=Qt.DirectConnection)
|
||||
self.activated[str].connect(self.history_selected)
|
||||
# QueuedConnection as workaround for https://bugreports.qt-project.org/browse/QTBUG-40807
|
||||
self.activated[str].connect(self.history_selected, type=Qt.QueuedConnection)
|
||||
self.setEditable(True)
|
||||
self.as_you_type = True
|
||||
self.timer = QTimer()
|
||||
|
|
@ -245,7 +245,8 @@ def set_search_string(self, txt, store_in_history=False, emit_changed=True):
|
|||
self.focus_to_library.emit()
|
||||
finally:
|
||||
if not store_in_history:
|
||||
self.activated[str].connect(self.history_selected)
|
||||
# QueuedConnection as workaround for https://bugreports.qt-project.org/browse/QTBUG-40807
|
||||
self.activated[str].connect(self.history_selected, type=Qt.QueuedConnection)
|
||||
|
||||
def search_as_you_type(self, enabled):
|
||||
self.as_you_type = enabled
|
||||
|
|
|
|||
Loading…
Reference in a new issue