From 6d648961c693a3b2319d9ea8974547bd2b4bbece Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Thu, 20 Sep 2018 22:58:07 +0200 Subject: QItemWidgets: emit layoutChanged with proper sortHint layout(AboutToBe)Changed gained a sortHint parameter with Qt5.0 but the itemmodels did not set a proper value where possible. Since the sorting of the ItemWidgets is only per column, it is reasonable to pass QAbstractItemModel::VerticalSortHint in the various layoutChanged calls. Change-Id: Ia11322bae1a96bc0d7d8422558a11cdfe04c2808 Reviewed-by: Samuel Gaist Reviewed-by: Richard Moe Gustavsen --- src/widgets/itemviews/qlistwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/itemviews/qlistwidget.cpp') diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp index 193e5bcb9c..895622616e 100644 --- a/src/widgets/itemviews/qlistwidget.cpp +++ b/src/widgets/itemviews/qlistwidget.cpp @@ -329,7 +329,7 @@ void QListModel::sort(int column, Qt::SortOrder order) if (column != 0) return; - emit layoutAboutToBeChanged(); + emit layoutAboutToBeChanged({}, QAbstractItemModel::VerticalSortHint); QVector < QPair > sorting(items.count()); for (int i = 0; i < items.count(); ++i) { @@ -353,7 +353,7 @@ void QListModel::sort(int column, Qt::SortOrder order) } changePersistentIndexList(fromIndexes, toIndexes); - emit layoutChanged(); + emit layoutChanged({}, QAbstractItemModel::VerticalSortHint); } /** -- cgit v1.2.3