I have a QtreeWidget, and I want to 'explore' it using it model data.
I have a vector<QStandardItemModel*>. First I add the main model for the tree.
I explore it and add new models to my vector if I find nodes with children.
( I think that with a simple code I can transverse the whole tree).
Ok, now I have :
tree_model->rowCount();
tree_model->columnCount();
tree_model= (QStandardItemModel*)QTreeWidget->model();
tree_model->rowCount();
tree_model->columnCount();
To copy to clipboard, switch view to plain text mode
But I dont know how to get the 'node' data. (text and datamodel)
I have to use a modelIndex?
QModelIndex mi = tree_model>index(row, col); ???
To copy to clipboard, switch view to plain text mode
But I could to use:
tree_model->item(row,col)->text();
tree_model->item(row,col)->has_children;
tree_model->item(row,col)->model()
tree_model->item(row,col)->text();
tree_model->item(row,col)->has_children;
tree_model->item(row,col)->model()
To copy to clipboard, switch view to plain text mode
But I have errors .... And I don find nothing useful at help reference
Any help ? Thanks.
Bookmarks