Move models to own library.

Took 35 minutes


Took 22 minutes
This commit is contained in:
Lukas Brübach 2025-11-05 11:46:14 +01:00
parent d914667238
commit d07f7d0f5a
73 changed files with 86 additions and 103 deletions

View file

@ -0,0 +1,19 @@
#include "token_display_model.h"
#include "../card_database_model.h"
TokenDisplayModel::TokenDisplayModel(QObject *parent) : CardDatabaseDisplayModel(parent)
{
}
bool TokenDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex & /*sourceParent*/) const
{
CardInfoPtr info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow);
return info->getIsToken() && rowMatchesCardName(info);
}
int TokenDisplayModel::rowCount(const QModelIndex &parent) const
{
// always load all tokens at start
return QSortFilterProxyModel::rowCount(parent);
}