2012-10-10 21:31:40 +02:00
|
|
|
#ifndef MODELITEM_HPP
|
|
|
|
#define MODELITEM_HPP
|
|
|
|
|
|
|
|
#include <QList>
|
2013-09-07 15:57:40 -05:00
|
|
|
#include <QMimeData>
|
2012-10-10 21:31:40 +02:00
|
|
|
|
2013-09-21 23:06:29 -05:00
|
|
|
namespace ContentSelectorModel
|
2012-10-10 21:31:40 +02:00
|
|
|
{
|
2013-09-07 15:57:40 -05:00
|
|
|
class ModelItem : public QMimeData
|
2013-08-18 15:11:29 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2012-10-10 21:31:40 +02:00
|
|
|
|
2013-08-18 15:11:29 -05:00
|
|
|
public:
|
2020-11-13 11:39:47 +04:00
|
|
|
ModelItem(ModelItem* parent = nullptr);
|
2013-09-07 15:57:40 -05:00
|
|
|
// ModelItem(const ModelItem *parent = 0);
|
|
|
|
|
2013-08-18 15:11:29 -05:00
|
|
|
~ModelItem();
|
2012-10-10 21:31:40 +02:00
|
|
|
|
2013-09-07 15:57:40 -05:00
|
|
|
ModelItem* parent() const;
|
2013-08-18 15:11:29 -05:00
|
|
|
int row() const;
|
2012-10-10 21:31:40 +02:00
|
|
|
|
2013-08-18 15:11:29 -05:00
|
|
|
int childCount() const;
|
|
|
|
int childRow(ModelItem* child) const;
|
|
|
|
ModelItem* child(int row);
|
2012-10-10 21:31:40 +02:00
|
|
|
|
2013-08-18 15:11:29 -05:00
|
|
|
void appendChild(ModelItem* child);
|
|
|
|
void removeChild(int row);
|
2012-10-10 21:31:40 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
bool hasFormat(const QString& mimetype) const override;
|
2013-09-07 15:57:40 -05:00
|
|
|
|
2013-08-18 15:11:29 -05:00
|
|
|
// virtual bool acceptChild(ModelItem *child);
|
2012-10-10 21:31:40 +02:00
|
|
|
|
2013-08-18 15:11:29 -05:00
|
|
|
protected:
|
|
|
|
ModelItem* mParentItem;
|
|
|
|
QList<ModelItem*> mChildItems;
|
|
|
|
};
|
|
|
|
}
|
2012-10-10 21:31:40 +02:00
|
|
|
|
|
|
|
#endif
|