Qt5 What is a const QModelIndex &sourceParent

181 Views Asked by At

I am attempting to move a row in a QTableView.

I know the current row index and the intended row index. I am attempting to use QAbstractItemModel::moveRow but I am having worst problem with the parameter const QModelIndex &sourceParent

Could you explain to me what a const QModelIndex &sourceParent is and give me an example on how to set one up?

or tell me a more straightforward way to move a row in a QTableView?

1

There are 1 best solutions below

0
On

It's for tree-models (when you have parents and childs). If you have a simple model just pass QModelIndex() there and it'd work.