From 28e6d251da54ddff3e232ab826beab84c8505dee Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 21 Nov 2021 10:17:42 +0530 Subject: [PATCH] More PyQt6 nonsense QCombobox::activated[str] no longer exists renamed to QComboBox::textActivated --- src/calibre/gui2/search_box.py | 8 ++++---- src/calibre/gui2/tag_browser/ui.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/search_box.py b/src/calibre/gui2/search_box.py index c2ec3fb8f9..19879cefc3 100644 --- a/src/calibre/gui2/search_box.py +++ b/src/calibre/gui2/search_box.py @@ -131,7 +131,7 @@ class SearchBox2(QComboBox): # {{{ self.line_edit.key_pressed.connect(self.key_pressed, type=Qt.ConnectionType.DirectConnection) # QueuedConnection as workaround for https://bugreports.qt-project.org/browse/QTBUG-40807 - self.activated[native_string_type].connect(self.history_selected, type=Qt.ConnectionType.QueuedConnection) + self.textActivated.connect(self.history_selected, type=Qt.ConnectionType.QueuedConnection) self.setEditable(True) self.as_you_type = True self.timer = QTimer() @@ -285,7 +285,7 @@ class SearchBox2(QComboBox): # {{{ def set_search_string(self, txt, store_in_history=False, emit_changed=True): if not store_in_history: - self.activated[native_string_type].disconnect() + self.textActivated.disconnect() try: self.setFocus(Qt.FocusReason.OtherFocusReason) if not txt: @@ -305,7 +305,7 @@ class SearchBox2(QComboBox): # {{{ finally: if not store_in_history: # QueuedConnection as workaround for https://bugreports.qt-project.org/browse/QTBUG-40807 - self.activated[native_string_type].connect(self.history_selected, type=Qt.ConnectionType.QueuedConnection) + self.textActivated.connect(self.history_selected, type=Qt.ConnectionType.QueuedConnection) def search_as_you_type(self, enabled): self.as_you_type = enabled @@ -337,7 +337,7 @@ class SavedSearchBox(QComboBox): # {{{ self.line_edit = SearchLineEdit(self) self.setLineEdit(self.line_edit) self.line_edit.key_pressed.connect(self.key_pressed, type=Qt.ConnectionType.DirectConnection) - self.activated[native_string_type].connect(self.saved_search_selected) + self.textActivated.connect(self.saved_search_selected) # Turn off auto-completion so that it doesn't interfere with typing # names of new searches. diff --git a/src/calibre/gui2/tag_browser/ui.py b/src/calibre/gui2/tag_browser/ui.py index 0b2b75f4cd..3f7da14ba9 100644 --- a/src/calibre/gui2/tag_browser/ui.py +++ b/src/calibre/gui2/tag_browser/ui.py @@ -642,7 +642,7 @@ class TagBrowserWidget(QFrame): # {{{ self.current_find_position = None self.search_button.clicked.connect(self.find) self.item_search.lineEdit().textEdited.connect(self.find_text_changed) - self.item_search.activated[str].connect(self.do_find) + self.item_search.textActivated.connect(self.do_find) # The tags view parent.tags_view = TagsView(parent)