Commit b448c967 authored by Dan Pascu's avatar Dan Pascu

Do not re-compute item in paintContactGroup

parent 49293c36
...@@ -299,12 +299,11 @@ class ContactDelegate(QStyledItemDelegate): ...@@ -299,12 +299,11 @@ class ContactDelegate(QStyledItemDelegate):
painter.restore() painter.restore()
def paintContactGroup(self, group, painter, option, index): def paintContactGroup(self, group, painter, option, index):
item = index.model().data(index, Qt.DisplayRole) if group.widget.size() != option.rect.size():
if item.widget.size() != option.rect.size():
# For some reason updateEditorGeometry only receives the peak value of # For some reason updateEditorGeometry only receives the peak value of
# the size that the widget ever had, so it will never shrink it. -Dan # the size that the widget ever had, so it will never shrink it. -Dan
item.widget.resize(option.rect.size()) group.widget.resize(option.rect.size())
item.widget.selected = bool(option.state & QStyle.State_Selected) group.widget.selected = bool(option.state & QStyle.State_Selected)
def paint(self, painter, option, index): def paint(self, painter, option, index):
item = index.model().data(index, Qt.DisplayRole) item = index.model().data(index, Qt.DisplayRole)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment