From 933df86bbcb96779b26d888a1e08fddbebbfcfe8 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 12 Sep 2018 08:52:49 +0200 Subject: QSFPM: setFilterRegExp and setFilterRegularExpression overloads to slots The setters of both filterRegExp and filterRegularExpression are currently normal functions. This patch moves them to slots to make them usable using the old syntax. This can be done since there are already overloads for both of them so people using the new connect syntax would have needed to use qOverload already therefore there is no SIC. [ChangeLog][QtCore][QSortFilterProxyModel] Setters of both the filterRegExp and filterRegularExpression properties are now slots and can be used with the old as well as the new syntax. Change-Id: Id5cd9a50fa4a62e2bbd6bd665b44bd25a0402852 Fixes: QTBUG-18113 Reviewed-by: David Faure --- src/corelib/itemmodels/qsortfilterproxymodel.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/itemmodels') diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h index 1304a95d13..0be8b88672 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.h +++ b/src/corelib/itemmodels/qsortfilterproxymodel.h @@ -88,11 +88,9 @@ public: QItemSelection mapSelectionFromSource(const QItemSelection &sourceSelection) const override; QRegExp filterRegExp() const; - void setFilterRegExp(const QRegExp ®Exp); #if QT_CONFIG(regularexpression) QRegularExpression filterRegularExpression() const; - void setFilterRegularExpression(const QRegularExpression ®ularExpression); #endif int filterKeyColumn() const; @@ -124,8 +122,10 @@ public: public Q_SLOTS: void setFilterRegExp(const QString &pattern); + void setFilterRegExp(const QRegExp ®Exp); #if QT_CONFIG(regularexpression) void setFilterRegularExpression(const QString &pattern); + void setFilterRegularExpression(const QRegularExpression ®ularExpression); #endif void setFilterWildcard(const QString &pattern); void setFilterFixedString(const QString &pattern); -- cgit v1.2.3 From ddeec1b07edc0f1f225f8dc52efefc2ff63049be Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 2 Oct 2018 02:39:21 +0200 Subject: QSFPM: don't let setFilterRegExp(QString) overwrite CaseSensitivity This is a regression from commit 346c15102b, which creates a new QRegExp in setFilterRegExp, losing previously set case sensitivity property (i.e. when the code does proxy->setFilterCaseSensitivity(Qt::CaseInsensitive) before setFilterRegExp). Interestingly that commit ensured that setFilterFixedString would still preserve CaseSensitivity, but not setFilterRegExp(QString). Change-Id: I3d37d001ce6e86dd90e7e07431440a42607172f9 Reviewed-by: Samuel Gaist Reviewed-by: Christian Ehrlicher Reviewed-by: Luca Beldi --- src/corelib/itemmodels/qsortfilterproxymodel.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/itemmodels') diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 31b9bbc990..21fbf83382 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -2731,6 +2731,7 @@ void QSortFilterProxyModel::setFilterRegExp(const QString &pattern) Q_D(QSortFilterProxyModel); d->filter_about_to_be_changed(); QRegExp rx(pattern); + rx.setCaseSensitivity(d->filter_data.caseSensitivity()); d->filter_data.setRegExp(rx); d->filter_changed(); } -- cgit v1.2.3