Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions panels/notification/bubble/bubblemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,16 @@ BubbleItem *BubbleModel::replaceBubble(BubbleItem *bubble)
Q_ASSERT(isReplaceBubble(bubble));
const auto replaceIndex = replaceBubbleIndex(bubble);
const auto oldBubble = m_bubbles[replaceIndex];
m_bubbles.replace(replaceIndex, bubble);
Q_EMIT dataChanged(index(replaceIndex), index(replaceIndex));

// Use remove + insert instead of dataChanged to force the view
// to recreate the delegate, so ListView recalculates its height.
beginRemoveRows(QModelIndex(), replaceIndex, replaceIndex);
m_bubbles.removeAt(replaceIndex);
endRemoveRows();

beginInsertRows(QModelIndex(), replaceIndex, replaceIndex);
m_bubbles.insert(replaceIndex, bubble);
endInsertRows();

return oldBubble;
}
Expand Down
Loading