added animation

but not full in ADeditor
This commit is contained in:
2010-09-05 16:25:23 +04:00
parent c898f978da
commit 8fa6b8e2a6
24 changed files with 924 additions and 725 deletions

View File

@@ -0,0 +1,35 @@
#include "animationmodel.h"
AnimationModel::AnimationModel(QList <tbAnimation> manims, QObject *parent) :
QAbstractListModel(parent)
{
anims = manims;
}
void AnimationModel::refresh(QList<tbAnimation>manims)
{
anims = manims;
}
int AnimationModel::rowCount(const QModelIndex &) const
{
return anims.count();
}
QVariant AnimationModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid())
return QVariant();
if (index.row() >= anims.size())
return QVariant();
if (role == Qt::DisplayRole)
{
return anims.at(index.row()).id;
}
return QVariant();
}