Selecting a row in QTreeView programmatically
Selecting a row in QTreeView programmatically
By using the Qitem selection :
selection->select ( QItemSelection ( treeview->model ()->index (search, 0), treeview->model ()->index (search, treeview->model ()->columnCount () - 1)), QItemSelectionModel::Select);
Click to set the choice action:
treeview->setSelectionBehavior (QAbstractItemView::SelectRows)
Row in QTreeView programmatically:
Unified the row using an QItemSelection.
selection->select(idx, QItemSelectionModel::Select | QItemSelectionModel::Rows);
By clearing the solutions:
selection->select(idx, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);