QModelIndex::isValid() does not guarantee that the index is still valid (it was valid, when it was created).

An index may become invalid whenever the model is changed (an obvious example being "you have an index to the last row, and that row is removed").

You must ensure that a QModelIndex you have obtained is not used anymore after a random modification to the model.

Each QPersistentModelIndex adds overhead to the model: all these are checked/adjusted when the model is changed (in a relevant way).

HTH