PDA

View Full Version : Child items do not appear in QStandardItemModel



MTK358
13th January 2012, 22:18
I have a QTreeView set to use a QStandardItemModel, and I add some items to it like this:


QStandardItem *i1 = new QStandardItem("test item");
QStandardItem *i2 = new QStandardItem("sub item");
i1->appendRow(i2);
m_tabModel->appendRow(i1);

"test item" appears, but "sub item" does not. What's wrong?

MTK358
14th January 2012, 00:33
I found the problem, I needed to call expandAll() on the view.