Emit layout change hint from QStandardItemModel.

Change-Id: I6d6a8c146b63c57634ae6b26ed5c1de249aa9e66
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Stephen Kelly 2012-09-27 11:13:47 +02:00 committed by The Qt Project
parent 5b96f53137
commit 308987fb96

View File

@ -1861,11 +1861,15 @@ void QStandardItem::sortChildren(int column, Qt::SortOrder order)
Q_D(QStandardItem);
if ((column < 0) || (rowCount() == 0))
return;
if (d->model)
emit d->model->layoutAboutToBeChanged();
QList<QPersistentModelIndex> parents;
if (d->model) {
parents << index();
emit d->model->layoutAboutToBeChanged(parents, QAbstractItemModel::VerticalSortHint);
}
d->sortChildren(column, order);
if (d->model)
emit d->model->layoutChanged();
emit d->model->layoutChanged(parents, QAbstractItemModel::VerticalSortHint);
}
/*!