I have a TreeModel that is displayed in a tree View. I also have a proxyModel that sets its source to the TreeModel and then gets displayed in a table view. The problem I am having is only the parent nodes are getting displayed in the table view.
My tree looks like the following:
parent1
| |_Child1_1
| |_Child1_2
|
parent2
| |_Child2_1
| |_Child2_2
|
parent3
My table looks like:
parent1
parent2
parent3
I would like to have it look like:
parent1
Child1_1
Child1_2
parent2
Child2_1
Child2_2
parent3
Here is a brief snipit of how I set everything up
TreeModel *model = new TreeModel(headers, file.readAll());
treeView->setModel(model);
mProxyModel = new MySortFilterProxyModel(model);
mProxyModel->setDynamicSortFilter(true);
mProxyModel->setSourceModel(model);
this->tableView->setModel(mProxyModel);
this->tableView->setSortingEnabled(true);
this->tableView->sortByColumn(0, Qt::AscendingOrder);
TreeModel *model = new TreeModel(headers, file.readAll());
treeView->setModel(model);
mProxyModel = new MySortFilterProxyModel(model);
mProxyModel->setDynamicSortFilter(true);
mProxyModel->setSourceModel(model);
this->tableView->setModel(mProxyModel);
this->tableView->setSortingEnabled(true);
this->tableView->sortByColumn(0, Qt::AscendingOrder);
To copy to clipboard, switch view to plain text mode
Does anyone know how I can go about displaying the children nodes in the table?
Bookmarks