2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef TREEITEM_H
|
|
|
|
#define TREEITEM_H
|
|
|
|
|
|
|
|
#include <QVariant>
|
2020-06-22 08:12:38 +00:00
|
|
|
#include <QList>
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
//! [0]
|
|
|
|
class TreeItem
|
|
|
|
{
|
|
|
|
public:
|
2020-06-22 08:12:38 +00:00
|
|
|
explicit TreeItem(const QList<QVariant> &data, TreeItem *parentItem = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
~TreeItem();
|
|
|
|
|
|
|
|
void appendChild(TreeItem *child);
|
|
|
|
|
|
|
|
TreeItem *child(int row);
|
|
|
|
int childCount() const;
|
|
|
|
int columnCount() const;
|
|
|
|
QVariant data(int column) const;
|
|
|
|
int row() const;
|
2014-05-15 21:34:21 +00:00
|
|
|
TreeItem *parentItem();
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private:
|
2020-06-22 08:12:38 +00:00
|
|
|
QList<TreeItem *> m_childItems;
|
|
|
|
QList<QVariant> m_itemData;
|
2014-05-15 21:34:21 +00:00
|
|
|
TreeItem *m_parentItem;
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
//! [0]
|
|
|
|
|
2012-11-22 12:40:51 +00:00
|
|
|
#endif // TREEITEM_H
|