You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
517 B
27 lines
517 B
#ifndef TREEITEM
|
|
#define TREEITEM
|
|
|
|
#include <QVariant>
|
|
#include <memory>
|
|
|
|
class TreeItem
|
|
{
|
|
public:
|
|
explicit TreeItem(QVariantList data);
|
|
|
|
void appendChild(std::unique_ptr<TreeItem>&& child);
|
|
|
|
TreeItem* child(int row);
|
|
int childCount() const;
|
|
int columnCount() const;
|
|
QVariant data(int column) const;
|
|
int row() const;
|
|
TreeItem* parentItem();
|
|
|
|
private:
|
|
std::vector<std::unique_ptr<TreeItem> > _childItems;
|
|
QVariantList _itemData;
|
|
TreeItem* _parentItem;
|
|
};
|
|
|
|
#endif //TREEITEM
|
|
|