summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-08-15 01:00:50 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-08-15 01:01:05 +0200
commit2959bdc6566d856d3e1e99db1f9d0a9af16abbf6 (patch)
tree2ed7c72e6e74c5bddccf1a0b04fdcc15fc7b3910 /src/widgets
parentd473f216b9a34a0e6272533dc11e885eebfe4191 (diff)
parent425d34b70edfea5f1be1c37f83f7919b9e2bd84a (diff)
Merge "Merge remote-tracking branch 'origin/5.13' into dev"
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/itemviews/qtableview.cpp8
-rw-r--r--src/widgets/itemviews/qtreeview.cpp4
-rw-r--r--src/widgets/util/qcompleter.h2
3 files changed, 10 insertions, 4 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
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 23a530821f..53e546bb4d 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -2619,7 +2619,7 @@ void QTreeView::sortByColumn(int column)
/*!
\since 4.2
- Sets the model up for sorting by the values in the given \a column and \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
@@ -2630,7 +2630,7 @@ void QTreeView::sortByColumn(int column)
void QTreeView::sortByColumn(int column, Qt::SortOrder order)
{
Q_D(QTreeView);
- if (column < 0)
+ if (column < -1)
return;
// If sorting is enabled it will emit a signal connected to
// _q_sortIndicatorChanged, which then actually sorts
diff --git a/src/widgets/util/qcompleter.h b/src/widgets/util/qcompleter.h
index 5620b55589..5448fc313c 100644
--- a/src/widgets/util/qcompleter.h
+++ b/src/widgets/util/qcompleter.h
@@ -75,12 +75,14 @@ public:
UnfilteredPopupCompletion,
InlineCompletion
};
+ Q_ENUM(CompletionMode)
enum ModelSorting {
UnsortedModel = 0,
CaseSensitivelySortedModel,
CaseInsensitivelySortedModel
};
+ Q_ENUM(ModelSorting)
QCompleter(QObject *parent = nullptr);
QCompleter(QAbstractItemModel *model, QObject *parent = nullptr);