Check parent in rowCount/columnCount/canFetchMore

Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
This commit is contained in:
TheLastRar
2022-11-13 14:35:55 +00:00
parent 5558f3d2cc
commit fce323b945
20 changed files with 41 additions and 41 deletions

View File

@ -15,12 +15,12 @@ ListModel::~ListModel() {}
int ListModel::rowCount(const QModelIndex& parent) const
{
return modpacks.size();
return parent.isValid() ? 0 : modpacks.size();
}
int ListModel::columnCount(const QModelIndex& parent) const
{
return 1;
return parent.isValid() ? 0 : 1;
}
QVariant ListModel::data(const QModelIndex& index, int role) const