Related questions
how set QCheckBox in QAbstractItemModel?
I have a model
class TreeModel : public QAbstractItemModel
which I populate with instances of my TreeItem excluding column==1. In column 1 I've created CheckBoxes:
QVariant TreeModel::data(const QModelIndex &index, int role) const {
if (!index.isValid())
return QVariant();
if (role != …
Insert and delete rows in QTreeView
Good day, I Have base model inherited from QAbstractItemModel, and some background threads which notify this model from time to time, in examples the insertions rows implemens somthing like this
bool TreeModel::insertRows(int position, int rows, const QModelIndex &…
Selecting a row in QTreeView programmatically
I have a QTreeView with QFileSystemModel as model.
The QTreeView has SelectionBehavior set to SelectRows.
In my code I read a dataset to select and then select them via:
idx = treeview->model()->index(search);
selection->select(…