Well, I tried to add the row to the model using
model->appendRow(rowList);
model->appendRow(rowList);
To copy to clipboard, switch view to plain text mode
instead of
item->appendRow(rowList);
item->appendRow(rowList);
To copy to clipboard, switch view to plain text mode
but the application is crashing anyway...
I tried to stick to code I found here (see 3.1 TreeView)
http://doc.troll.no/master-snapshot/modelview.html
QList<QStandardItem *> preparedRow =prepareRow("first", "second", "third");
// adding a row to the invisible root item produces a root element
item->appendRow(preparedRow);
standardModel = new QStandardItemModel ;
QList<QStandardItem *> preparedRow =prepareRow("first", "second", "third");
QStandardItem *item = standardModel->invisibleRootItem();
// adding a row to the invisible root item produces a root element
item->appendRow(preparedRow);
To copy to clipboard, switch view to plain text mode
Bookmarks