Fix TimelineEndDelegate and SuccessorDelegate

This commit is contained in:
Tobias Fella
2026-02-20 12:30:32 +01:00
committed by Tobias Fella
parent 2c5bef6e96
commit b0dce5fd0a

View File

@@ -105,6 +105,10 @@ QVariant TimelineBeginningModel::data(const QModelIndex &idx, int role) const
}
return DelegateType::Successor;
}
if (role == MessageModel::RoomRole) {
return QVariant::fromValue(m_room.get());
}
return {};
}
@@ -119,7 +123,10 @@ int TimelineBeginningModel::rowCount(const QModelIndex &parent) const
QHash<int, QByteArray> TimelineBeginningModel::roleNames() const
{
return {{DelegateTypeRole, "delegateType"}};
return {
{DelegateTypeRole, "delegateType"},
{MessageModel::RoomRole, "room"},
};
}
TimelineEndModel::TimelineEndModel(QObject *parent)
@@ -170,6 +177,10 @@ QVariant TimelineEndModel::data(const QModelIndex &idx, int role) const
return DelegateType::Predecessor;
}
}
if (role == MessageModel::RoomRole) {
return QVariant::fromValue(m_room.get());
}
return {};
}
@@ -184,7 +195,10 @@ int TimelineEndModel::rowCount(const QModelIndex &parent) const
QHash<int, QByteArray> TimelineEndModel::roleNames() const
{
return {{DelegateTypeRole, "delegateType"}};
return {
{DelegateTypeRole, "delegateType"},
{MessageModel::RoomRole, "room"},
};
}
#include "moc_timelinemodel.cpp"