More PyQt6 nonsense

QCombobox::activated[str] no longer exists renamed to
QComboBox::textActivated
This commit is contained in:
Kovid Goyal 2021-11-21 10:17:42 +05:30
parent 053fd6f5bf
commit 28e6d251da
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 5 deletions

View File

@ -131,7 +131,7 @@ class SearchBox2(QComboBox): # {{{
self.line_edit.key_pressed.connect(self.key_pressed, type=Qt.ConnectionType.DirectConnection) 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 # 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.setEditable(True)
self.as_you_type = True self.as_you_type = True
self.timer = QTimer() self.timer = QTimer()
@ -285,7 +285,7 @@ class SearchBox2(QComboBox): # {{{
def set_search_string(self, txt, store_in_history=False, emit_changed=True): def set_search_string(self, txt, store_in_history=False, emit_changed=True):
if not store_in_history: if not store_in_history:
self.activated[native_string_type].disconnect() self.textActivated.disconnect()
try: try:
self.setFocus(Qt.FocusReason.OtherFocusReason) self.setFocus(Qt.FocusReason.OtherFocusReason)
if not txt: if not txt:
@ -305,7 +305,7 @@ class SearchBox2(QComboBox): # {{{
finally: finally:
if not store_in_history: if not store_in_history:
# QueuedConnection as workaround for https://bugreports.qt-project.org/browse/QTBUG-40807 # 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): def search_as_you_type(self, enabled):
self.as_you_type = enabled self.as_you_type = enabled
@ -337,7 +337,7 @@ class SavedSearchBox(QComboBox): # {{{
self.line_edit = SearchLineEdit(self) self.line_edit = SearchLineEdit(self)
self.setLineEdit(self.line_edit) self.setLineEdit(self.line_edit)
self.line_edit.key_pressed.connect(self.key_pressed, type=Qt.ConnectionType.DirectConnection) 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 # Turn off auto-completion so that it doesn't interfere with typing
# names of new searches. # names of new searches.

View File

@ -642,7 +642,7 @@ class TagBrowserWidget(QFrame): # {{{
self.current_find_position = None self.current_find_position = None
self.search_button.clicked.connect(self.find) self.search_button.clicked.connect(self.find)
self.item_search.lineEdit().textEdited.connect(self.find_text_changed) 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 # The tags view
parent.tags_view = TagsView(parent) parent.tags_view = TagsView(parent)