Skip to content

Commit

Permalink
Fix setFocus() call
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zas authored and phw committed May 6, 2024
1 parent fbc6ca8 commit b473f47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion picard/ui/mainwindow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit b473f47

Please sign in to comment.