diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-06-22 19:54:17 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-08-25 19:03:10 +0200 |
commit | 4d8b8c3b816528ece6274bac97d30905f77aabfb (patch) | |
tree | 44948aeab0dbab56b46a7205edcfb3003ccad3b8 /src/timeline/TimelineModel.cpp | |
parent | Merge pull request #1536 from Nheko-Reborn/issue1440 (diff) | |
download | nheko-4d8b8c3b816528ece6274bac97d30905f77aabfb.tar.xz |
Create an EventDelegateChooser
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-rw-r--r-- | src/timeline/TimelineModel.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index b2a036c5..69ab3f5a 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -926,6 +926,26 @@ TimelineModel::multiData(const QModelIndex &index, QModelRoleDataSpan roleDataSp } } +void +TimelineModel::multiData(const QString &id, + const QString &relatedTo, + QModelRoleDataSpan roleDataSpan) const +{ + if (id.isEmpty()) + return; + + auto event = events.get(id.toStdString(), relatedTo.toStdString()); + + if (!event) + return; + + for (QModelRoleData &roleData : roleDataSpan) { + int role = roleData.role(); + + roleData.setData(data(*event, role)); + } +} + QVariant TimelineModel::dataById(const QString &id, int role, const QString &relatedTo) { |