From d37cc4ac73545c6a2615456a3487536c2ec00803 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 26 Aug 2021 17:44:49 +0200 Subject: Fix style enum access --- qutebrowser/completion/completiondelegate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'qutebrowser') diff --git a/qutebrowser/completion/completiondelegate.py b/qutebrowser/completion/completiondelegate.py index 4e9d14d1a..ff134183b 100644 --- a/qutebrowser/completion/completiondelegate.py +++ b/qutebrowser/completion/completiondelegate.py @@ -94,7 +94,7 @@ class CompletionItemDelegate(QStyledItemDelegate): """Draw the background of an ItemViewItem.""" assert self._opt is not None assert self._style is not None - self._style.drawPrimitive(self._style.PE_PanelItemViewItem, self._opt, + self._style.drawPrimitive(QStyle.PrimitiveElement.PE_PanelItemViewItem, self._opt, self._painter, self._opt.widget) def _draw_icon(self): @@ -103,7 +103,7 @@ class CompletionItemDelegate(QStyledItemDelegate): assert self._style is not None icon_rect = self._style.subElementRect( - self._style.SE_ItemViewItemDecoration, self._opt, self._opt.widget) + QStyle.SubElement.SE_ItemViewItemDecoration, self._opt, self._opt.widget) if not icon_rect.isValid(): # The rect seems to be wrong in all kind of ways if no icon should # be displayed. @@ -134,7 +134,7 @@ class CompletionItemDelegate(QStyledItemDelegate): return text_rect_ = self._style.subElementRect( - self._style.SE_ItemViewItemText, self._opt, self._opt.widget) + QStyle.SubElement.SE_ItemViewItemText, self._opt, self._opt.widget) qtutils.ensure_valid(text_rect_) margin = self._style.pixelMetric(QStyle.PixelMetric.PM_FocusFrameHMargin, self._opt, self._opt.widget) + 1 @@ -257,7 +257,7 @@ class CompletionItemDelegate(QStyledItemDelegate): return o = self._opt o.rect = self._style.subElementRect( - self._style.SE_ItemViewItemFocusRect, self._opt, self._opt.widget) + QStyle.SubElement.SE_ItemViewItemFocusRect, self._opt, self._opt.widget) o.state |= int(QStyle.StateFlag.State_KeyboardFocusChange | QStyle.StateFlag.State_Item) qtutils.ensure_valid(o.rect) if state & QStyle.StateFlag.State_Enabled: -- cgit v1.2.3-54-g00ecf