summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-06-10 10:20:04 +0200
committerFlorian Bruhin <me@the-compiler.org>2022-06-22 17:41:12 +0200
commita7a1654f1c55d8f312473ca59966cea1e96bbeaa (patch)
treea6b60c12ca3b2f1f8d412aeab2e433a1ea51fa05
parentd00b18264af2da5d64c5fe32f3c3600cf9c8e05d (diff)
downloadqutebrowser-a7a1654f1c55d8f312473ca59966cea1e96bbeaa.tar.gz
qutebrowser-a7a1654f1c55d8f312473ca59966cea1e96bbeaa.zip
Remove extra int() for drawing focus rect
Seems to be called rather infrequently (when focusing some other window even?) but then crash with: Traceback (most recent call last): File ".../qutebrowser/completion/completiondelegate.py", line 323, in paint self._draw_focus_rect() File ".../qutebrowser/completion/completiondelegate.py", line 263, in _draw_focus_rect o.state |= int(QStyle.StateFlag.State_KeyboardFocusChange | QStyle.StateFlag.State_Item) TypeError: int() argument must be a string, a bytes-like object or a real number, not 'StateFlag'
-rw-r--r--qutebrowser/completion/completiondelegate.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/qutebrowser/completion/completiondelegate.py b/qutebrowser/completion/completiondelegate.py
index bc7f2f9c2..f6fec39f6 100644
--- a/qutebrowser/completion/completiondelegate.py
+++ b/qutebrowser/completion/completiondelegate.py
@@ -260,7 +260,7 @@ class CompletionItemDelegate(QStyledItemDelegate):
o = self._opt
o.rect = self._style.subElementRect(
QStyle.SubElement.SE_ItemViewItemFocusRect, self._opt, self._opt.widget)
- o.state |= int(QStyle.StateFlag.State_KeyboardFocusChange | QStyle.StateFlag.State_Item)
+ o.state |= QStyle.StateFlag.State_KeyboardFocusChange | QStyle.StateFlag.State_Item
qtutils.ensure_valid(o.rect)
if state & QStyle.StateFlag.State_Enabled:
cg = QPalette.ColorGroup.Normal