ADeditor
This commit is contained in:
@@ -1,6 +1,35 @@
|
||||
#include "splashmodel.h"
|
||||
|
||||
SplashModel::SplashModel(QList<tbSplash> splashes, QObject *parent) :
|
||||
SplashModel::SplashModel(QList<tbSplash> msplashes, QObject *parent) :
|
||||
QAbstractListModel(parent)
|
||||
{
|
||||
splashes = msplashes;
|
||||
}
|
||||
|
||||
|
||||
void SplashModel::refresh(QList<tbSplash> msplashes)
|
||||
{
|
||||
splashes = msplashes;
|
||||
}
|
||||
|
||||
|
||||
int SplashModel::rowCount(const QModelIndex &) const
|
||||
{
|
||||
return splashes.count();
|
||||
}
|
||||
|
||||
|
||||
QVariant SplashModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return QVariant();
|
||||
|
||||
if (index.row() >= splashes.size())
|
||||
return QVariant();
|
||||
|
||||
if (role == Qt::DisplayRole)
|
||||
{
|
||||
return splashes.at(index.row()).name;
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user