From be68f98ce73b75091053c2a3754630b0e69a467d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 23 Jun 2014 08:20:40 +0200 Subject: [PATCH] Don't crash on invalid icon rect --- qutebrowser/widgets/completiondelegate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qutebrowser/widgets/completiondelegate.py b/qutebrowser/widgets/completiondelegate.py index fef24c809..c52ae2b00 100644 --- a/qutebrowser/widgets/completiondelegate.py +++ b/qutebrowser/widgets/completiondelegate.py @@ -71,9 +71,10 @@ class CompletionItemDelegate(QStyledItemDelegate): """Draw the icon of an ItemViewItem.""" icon_rect = self._style.subElementRect( self._style.SE_ItemViewItemDecoration, self._opt, self._opt.widget) - if icon_rect.isNull(): + if not icon_rect.isValid(): + # The rect seems to be wrong in all kind of ways if no icon should + # be displayed. return - qt_ensure_valid(icon_rect) mode = QIcon.Normal if not self._opt.state & QStyle.State_Enabled: