S
S
sitev_ru2015-08-06 07:53:04
Qt
sitev_ru, 2015-08-06 07:53:04

How to add a branch to a QTreeView?

How to add a branch to a QTreeView? Add child branch?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kozura, 2015-08-06
@sitev_ru

Like this:

QTreeWidgetItem* top_level = new QTreeWidgetItem(m_three);

QTreeWidgetItem* child_item = new QTreeWidgetItem(top_level);

Or:
QStandardItemModel model(rows, columns);

QStandardItem *item = new QStandardItem("top");
QStandardItem *child = new QStandardItem("child");

model.setItem(row, column, item);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question