added triggers onTimer

added map view in ADeditor
This commit is contained in:
2010-09-02 23:34:39 +04:00
parent 7752f7be12
commit c898f978da
10 changed files with 169 additions and 15 deletions

35
ADeditor/mapmodel.cpp Normal file
View File

@@ -0,0 +1,35 @@
#include "mapmodel.h"
MapModel::MapModel(QList <tbMap> mmaps, QObject *parent) :
QAbstractListModel(parent)
{
maps = mmaps;
}
void MapModel::refresh(QList <tbMap> mmaps)
{
maps = mmaps;
}
int MapModel::rowCount(const QModelIndex &) const
{
return maps.count();
}
QVariant MapModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid())
return QVariant();
if (index.row() >= maps.size())
return QVariant();
if (role == Qt::DisplayRole)
{
return maps.at(index.row()).name;
}
return QVariant();
}