Bob
Bob

Reputation: 4970

QAbstractItemModel - inserting rows - how to specify the columns

The doc shows a table

Table Model

But the API does not allow you to specify the column under which to insert the rows.

void QAbstractItemModel::beginInsertRows(const QModelIndex &parent, int first, int last)

enter image description here

Under which column does the row get inserted?

Upvotes: 1

Views: 159

Answers (1)

chehrlic
chehrlic

Reputation: 958

You always insert a complete row, not a single cell so when adding a row into a table model the parent is the root index (= invalid QModelIndex), if you insert into a tree then the parent is the parent node.

Upvotes: 2

Related Questions