1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 04:53:52 +00:00
openmw/components/contentselector/model/modelitem.hpp

40 lines
794 B
C++
Raw Normal View History

#ifndef MODELITEM_HPP
#define MODELITEM_HPP
#include <QList>
2022-09-22 18:26:05 +00:00
#include <QMimeData>
namespace ContentSelectorModel
{
2013-09-07 20:57:40 +00:00
class ModelItem : public QMimeData
{
Q_OBJECT
public:
2022-09-22 18:26:05 +00:00
ModelItem(ModelItem* parent = nullptr);
// ModelItem(const ModelItem *parent = 0);
2013-09-07 20:57:40 +00:00
~ModelItem();
2022-09-22 18:26:05 +00:00
ModelItem* parent() const;
int row() const;
int childCount() const;
2022-09-22 18:26:05 +00:00
int childRow(ModelItem* child) const;
ModelItem* child(int row);
2022-09-22 18:26:05 +00:00
void appendChild(ModelItem* child);
void removeChild(int row);
2022-09-22 18:26:05 +00:00
bool hasFormat(const QString& mimetype) const override;
2013-09-07 20:57:40 +00:00
2022-09-22 18:26:05 +00:00
// virtual bool acceptChild(ModelItem *child);
protected:
2022-09-22 18:26:05 +00:00
ModelItem* mParentItem;
QList<ModelItem*> mChildItems;
};
}
#endif