Doc: Add note about sortColumn() and sort() behavior

While available in their respective function level descriptions,
add a note about the behavior of the sortColumn() and sort()
functions in the sorting section of QSortFilterProxyModel's
detailed description in order to promote this information
to the reader.

Fixes: QTBUG-125718
Pick-to: 6.7 6.5
Change-Id: Ib7a3c206cd49b446b11063850d294da0811a282c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 014d2f075ebf811e560aad89a4e8de491e3a179c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Andreas Eliasson 2024-07-05 12:48:34 +02:00 committed by Qt Cherry-pick Bot
parent 33c7170fcb
commit 4a087d3e45

View File

@ -1943,6 +1943,11 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved(
QSortFilterProxyModel can be sorted by column -1, in which case it returns
to the sort order of the underlying source model.
\note \l sortColumn() returns the most recently used sort column.
The default value is -1, which means that this proxy model does not sort.
Also, note that \l sort() sets the \l sortColumn() to the most recently
used sort column.
\section1 Filtering
In addition to sorting, QSortFilterProxyModel can be used to hide items
@ -2496,6 +2501,8 @@ QSize QSortFilterProxyModel::span(const QModelIndex &index) const
Sorts the model by \a column in the given \a order.
If the sort \a column is less than zero, the model will be sorted by source model row
in the given \a order.
\sa sortColumn()
*/
void QSortFilterProxyModel::sort(int column, Qt::SortOrder order)
{