diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-08-15 01:00:50 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-08-15 01:00:51 +0200 |
commit | 425d34b70edfea5f1be1c37f83f7919b9e2bd84a (patch) | |
tree | adb4ffb4383a068d5385e8965aee7b9a1a0026af /src/widgets/itemviews/qtableview.cpp | |
parent | 1d496a4a1085e6a3ebaa0448b8d6c4da6f8f50d6 (diff) | |
parent | 8bd48a1c335b404ebbeb7c09c859e0715e6b5cd4 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Icc80dacbca8613f2996be75553ff15d0ad242b7e
Diffstat (limited to 'src/widgets/itemviews/qtableview.cpp')
-rw-r--r-- | src/widgets/itemviews/qtableview.cpp | 8 |
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 |