This commit is contained in:
unknown
2010-08-25 23:49:21 +04:00
parent 8d6a589224
commit 71a6a951e0
10 changed files with 566 additions and 40 deletions

View File

@@ -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();
}