Fix updating events when delegate choice changes
This commit is contained in:
@@ -353,8 +353,11 @@ void MessageEventModel::refreshLastUserEvents(int baseTimelineRow)
|
|||||||
const auto limit = timelineBottom + std::min(baseTimelineRow + 10, m_currentRoom->timelineSize());
|
const auto limit = timelineBottom + std::min(baseTimelineRow + 10, m_currentRoom->timelineSize());
|
||||||
for (auto it = timelineBottom + std::max(baseTimelineRow - 10, 0); it != limit; ++it) {
|
for (auto it = timelineBottom + std::max(baseTimelineRow - 10, 0); it != limit; ++it) {
|
||||||
if ((*it)->senderId() == lastSender) {
|
if ((*it)->senderId() == lastSender) {
|
||||||
auto idx = index(it - timelineBottom);
|
// See https://bugreports.qt.io/browse/QTBUG-84093
|
||||||
Q_EMIT dataChanged(idx, idx);
|
beginRemoveRows(QModelIndex(), it - timelineBottom, it - timelineBottom);
|
||||||
|
endRemoveRows();
|
||||||
|
beginInsertRows(QModelIndex(), it - timelineBottom, it - timelineBottom);
|
||||||
|
endInsertRows();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user