Currently, there is a problem with line number 5, QT doesn't allow to change the QTreeWidget model.

Is there a view to fixing this problem? instead of using QtreeView.


Qt Code:
  1. QAbstractItemModel * sourceModel;
  2. sourceModel = ui->treeWidget->model();
  3. proxyModel->setSourceModel(sourceModel);
  4. ui->treeWidget->QTreeWidget::setModel(proxyModel);
To copy to clipboard, switch view to plain text mode