Emit layout change hint from QStandardItemModel.
Change-Id: I6d6a8c146b63c57634ae6b26ed5c1de249aa9e66 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
5b96f53137
commit
308987fb96
@ -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);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user