2012-10-10 19:31:40 +00:00
|
|
|
#ifndef MODELITEM_HPP
|
|
|
|
#define MODELITEM_HPP
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QList>
|
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
namespace EsxModel
|
2012-10-10 19:31:40 +00:00
|
|
|
{
|
2013-08-18 20:11:29 +00:00
|
|
|
class ModelItem : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2012-10-10 19:31:40 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
public:
|
|
|
|
ModelItem(ModelItem *parent = 0);
|
|
|
|
~ModelItem();
|
2012-10-10 19:31:40 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
ModelItem *parent();
|
|
|
|
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-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
|