Custom QAbstractItemModel & persistentIndexList
-
HI
I have custom QAbstractListModel called MTModel.
It has 20 rows of data.
Implemented the following functions in modelint rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const ; QHash<int, QByteArray> roleNames() const;When I call
QModelIndexList pIndexList = this->persistentIndexList();It always return 0(zero)
Any idea why it returns zero ? I was expecting this as 20.
Any thing missing here ? -
Hi,
Do you create any such indexes ?
If not then that's normal that the list is empty.