diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2015-04-30 12:44:34 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2015-05-01 09:12:19 +0000 |
commit | 70b085c4650da0994d07baa33701ccfd4a452bb8 (patch) | |
tree | cf923ca882a2f9d8e32a4b7b0503c1f6030b7ff7 /src/corelib/itemmodels | |
parent | 985e7d8094437b64378370cedad76c7fb7e24c31 (diff) |
QSortFilterProxyModel: improve formal argument naming for lessThan
Make it clear (just like the other methods) that the indexes refer
to the source model, not the proxy model. There was already a note
in the documentation, but it was at the end of it; instead, change
the formal arguments names.
Change-Id: Ia9592f2b080ff276a62de1713a9623e0f3a50cf6
Reviewed-by: Tobias Koenig
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib/itemmodels')
-rw-r--r-- | src/corelib/itemmodels/qsortfilterproxymodel.cpp | 10 | ||||
-rw-r--r-- | src/corelib/itemmodels/qsortfilterproxymodel.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 3a604c15f4..922d0f1622 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -2577,8 +2577,8 @@ void QSortFilterProxyModel::invalidateFilter() /*! Returns \c true if the value of the item referred to by the given - index \a left is less than the value of the item referred to by - the given index \a right, otherwise returns \c false. + index \a source_left is less than the value of the item referred to by + the given index \a source_right, otherwise returns \c false. This function is used as the < operator when sorting, and handles the following QVariant types: @@ -2612,11 +2612,11 @@ void QSortFilterProxyModel::invalidateFilter() \sa sortRole, sortCaseSensitivity, dynamicSortFilter */ -bool QSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const +bool QSortFilterProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const { Q_D(const QSortFilterProxyModel); - QVariant l = (left.model() ? left.model()->data(left, d->sort_role) : QVariant()); - QVariant r = (right.model() ? right.model()->data(right, d->sort_role) : QVariant()); + QVariant l = (source_left.model() ? source_left.model()->data(source_left, d->sort_role) : QVariant()); + QVariant r = (source_right.model() ? source_right.model()->data(source_right, d->sort_role) : QVariant()); switch (l.userType()) { case QVariant::Invalid: return (r.type() != QVariant::Invalid); diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h index 9ba4e48d09..a08d7c6416 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.h +++ b/src/corelib/itemmodels/qsortfilterproxymodel.h @@ -111,7 +111,7 @@ public Q_SLOTS: protected: virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; virtual bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const; - virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const; + virtual bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; void filterChanged(); void invalidateFilter(); |