From b473f47c8cde7606fd70c775eb33ff402a74b07b Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Mon, 6 May 2024 10:59:48 +0200 Subject: [PATCH] Fix setFocus() call How to reproduce: - press CTRL+F on main panel Traceback (most recent call last): File "/home/zas/src/picard/./picard/ui/mainwindow/__init__.py", line 277, in keyPressEvent self.search_edit.setFocus(True) TypeError: arguments did not match any overloaded call: setFocus(self): too many arguments setFocus(self, reason: Qt.FocusReason): argument 1 has unexpected type 'bool' Solution: - pass proper Qt.FocusReason; not True --- picard/ui/mainwindow/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/picard/ui/mainwindow/__init__.py b/picard/ui/mainwindow/__init__.py index 50549e3275..d793b3f3b4 100644 --- a/picard/ui/mainwindow/__init__.py +++ b/picard/ui/mainwindow/__init__.py @@ -274,7 +274,7 @@ def keyPressEvent(self, event): else: self.remove() elif event.matches(QtGui.QKeySequence.StandardKey.Find): - self.search_edit.setFocus(True) + self.search_edit.setFocus(QtCore.Qt.FocusReason.ShortcutFocusReason) else: super().keyPressEvent(event)