27 parent_item_ = parent;
32 qDeleteAll(child_items_);
37 child_items_.append(child);
42 child_items_.removeOne(child);
47 return child_items_.value(row);
52 return child_items_.count();
57 return item_data_.count();
62 return item_data_.value(column);
68 return parent_item_->
child_items().indexOf(const_cast<TreeItem*>(
this));
84 if (item_data_.size() > 1)
85 item_data_[1] = QVariant(new_type);
110 QStringList child_names;
111 for (
auto item: child_items_)
112 child_names << item->data(0).toString();
118 for (
auto child_item: child_items_)
119 if (child_item->data(0) == name)
TreeItem * child(int row)
void removeChild(TreeItem *child)
TreeItem::ItemType type() const
void UpdateType(QString new_type)
void appendChild(TreeItem *child)
QStringList ChildNames() const
const QString DatasetKey() const
bool HasChild(const QString &name)
QVariant data(int column) const
QList< TreeItem * > child_items()
TreeItem(TreeItem::ItemType type, QStringList &keys, QList< QVariant > &data, TreeItem *parent=0)