diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-09-20 22:58:07 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-09-24 19:02:55 +0000 |
commit | 6d648961c693a3b2319d9ea8974547bd2b4bbece (patch) | |
tree | 35b12725ee869bb744b09a1ad6ba88febc8f8fdd /src/widgets/itemviews/qlistwidget.cpp | |
parent | 47f815cb2617736de2777675bc107843d1c61def (diff) |
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 <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/itemviews/qlistwidget.cpp')
-rw-r--r-- | src/widgets/itemviews/qlistwidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<QListWidgetItem*,int> > 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); } /** |