summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qtableview.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-09-04 14:33:40 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-09-04 14:33:40 +0200
commitf255b1e8e297e7e1363921580007145cff574e0d (patch)
tree9a799be282e6c0d6544d9f8c872073f83e6c0475 /src/widgets/itemviews/qtableview.cpp
parent7e8705f6632428a8d9a937ab5fe087999347b3dd (diff)
parentbf8fcab8bb92ff534c5cec048d6dbebb3b73a348 (diff)
Merge remote-tracking branch 'origin/dev' into wip/qt6
Diffstat (limited to 'src/widgets/itemviews/qtableview.cpp')
-rw-r--r--src/widgets/itemviews/qtableview.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index e706af1a42..c50156bbce 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -3186,14 +3186,18 @@ void QTableView::sortByColumn(int column)
/*!
\since 4.2
- Sorts the model by the values in the given \a column in the given \a order.
+ Sorts the model by the values in the given \a column and \a order.
+
+ \a column may be -1, in which case no sort indicator will be shown
+ and the model will return to its natural, unsorted order. Note that not
+ all models support this and may even crash in this case.
\sa sortingEnabled
*/
void QTableView::sortByColumn(int column, Qt::SortOrder order)
{
Q_D(QTableView);
- if (column < 0)
+ if (column < -1)
return;
// If sorting is enabled it will emit a signal connected to
// _q_sortIndicatorChanged, which then actually sorts