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
552 B
27 lines
552 B
#ifndef TREEITEM
|
|
#define TREEITEM
|
|
|
|
#include <QVariant>
|
|
#include <memory>
|
|
|
|
class TreeItem
|
|
{
|
|
public:
|
|
explicit TreeItem(QVariantList data, TreeItem* parentItem = nullptr);
|
|
|
|
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> > m_childItems;
|
|
QVariantList m_itemData;
|
|
TreeItem* m_parentItem;
|
|
};
|
|
|
|
#endif //TREEITEM
|
|
|