2012-10-10 19:31:40 +00:00
|
|
|
#ifndef MODELITEM_HPP
|
|
|
|
#define MODELITEM_HPP
|
|
|
|
|
2013-09-07 20:57:40 +00:00
|
|
|
#include <QMimeData>
|
2012-10-10 19:31:40 +00:00
|
|
|
#include <QList>
|
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
namespace EsxModel
|
2012-10-10 19:31:40 +00:00
|
|
|
{
|
2013-09-07 20:57:40 +00:00
|
|
|
class ModelItem : public QMimeData
|
2013-08-18 20:11:29 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2012-10-10 19:31:40 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
public:
|
|
|
|
ModelItem(ModelItem *parent = 0);
|
2013-09-07 20:57:40 +00:00
|
|
|
//ModelItem(const ModelItem *parent = 0);
|
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
~ModelItem();
|
2012-10-10 19:31:40 +00:00
|
|
|
|
2013-09-07 20:57:40 +00:00
|
|
|
ModelItem *parent() const;
|
2013-08-18 20:11:29 +00:00
|
|
|
int row() const;
|
2012-10-10 19:31:40 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
int childCount() const;
|
|
|
|
int childRow(ModelItem *child) const;
|
|
|
|
ModelItem *child(int row);
|
2012-10-10 19:31:40 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
void appendChild(ModelItem *child);
|
|
|
|
void removeChild(int row);
|
2012-10-10 19:31:40 +00:00
|
|
|
|
2013-09-07 20:57:40 +00:00
|
|
|
bool hasFormat(const QString &mimetype) const;
|
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
//virtual bool acceptChild(ModelItem *child);
|
2012-10-10 19:31:40 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
protected:
|
|
|
|
ModelItem *mParentItem;
|
|
|
|
QList<ModelItem*> mChildItems;
|
|
|
|
};
|
|
|
|
}
|
2012-10-10 19:31:40 +00:00
|
|
|
|
|
|
|
#endif
|