QModelIndex index = model->index(row, col, parentIndex); QModelIndex parentIndex = index.parent();
void MyModel::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVectorIn this example, we have a custom implementation of dataChanged() in a model subclass. We retrieve the parent of the top-left index that has changed, and then emit a signal indicating that the parent index has changed as well. Package/Library: Qt Framework.&roles) { QModelIndex parentIndex = topLeft.parent(); emit dataChanged(parentIndex, parentIndex); }