2016-09-09 22:13:21 +02:00
|
|
|
#pragma once
|
2014-03-01 12:19:33 +01:00
|
|
|
#ifndef _ANIMATIONLISTMODEL_HPP_
|
|
|
|
#define _ANIMATIONLISTMODEL_HPP_
|
|
|
|
#include <QAbstractItemModel>
|
|
|
|
#include <loaders/LoaderIFP.hpp>
|
|
|
|
|
|
|
|
typedef std::vector<std::pair<std::string, Animation*>> AnimationList;
|
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
class AnimationListModel : public QAbstractListModel {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
AnimationList animations;
|
|
|
|
|
2014-03-01 12:19:33 +01:00
|
|
|
public:
|
2016-09-09 22:13:21 +02:00
|
|
|
AnimationListModel(const AnimationList& anims, QObject* parent = 0)
|
|
|
|
: QAbstractListModel(parent), animations(anims) {
|
|
|
|
}
|
2014-03-01 12:19:33 +01:00
|
|
|
|
|
|
|
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
|
2016-09-09 22:13:21 +02:00
|
|
|
|
2014-03-01 12:19:33 +01:00
|
|
|
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
|
2016-09-09 22:13:21 +02:00
|
|
|
|
|
|
|
virtual QVariant data(const QModelIndex& index,
|
|
|
|
int role = Qt::DisplayRole) const;
|
|
|
|
|
|
|
|
virtual QVariant headerData(int section, Qt::Orientation orientation,
|
|
|
|
int role = Qt::DisplayRole) const;
|
|
|
|
|
|
|
|
const AnimationList& getAnimations() const {
|
|
|
|
return animations;
|
|
|
|
}
|
2014-03-01 12:19:33 +01:00
|
|
|
};
|
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
#endif
|