summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2021-12-02 18:17:35 +0100
committerMarc Mutz <marc.mutz@qt.io>2021-12-03 13:36:55 +0100
commitb29639a83cdcbd49316cfe299dfce5354e5bcaf7 (patch)
tree2c638fe40724d529e512e553ec7927e1d4191f00
parent99b6699e70d0455b2fb0b1dbb80a98c3b5842f9a (diff)
QPdfSearchModel: take a QString arg by cref, not value
The function is not a perfect sink for the argument, and the implementation wasn't moving from the argument, anyway, so do the common thing here and take by cref. Task-number: QTBUG-98796 Change-Id: I4237e50cf9c00817245ad8967bf7e2976ffb7085 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/pdf/qpdfsearchmodel.cpp2
-rw-r--r--src/pdf/qpdfsearchmodel.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp
index c3af8937d..e515cabfd 100644
--- a/src/pdf/qpdfsearchmodel.cpp
+++ b/src/pdf/qpdfsearchmodel.cpp
@@ -126,7 +126,7 @@ QString QPdfSearchModel::searchString() const
return d->searchString;
}
-void QPdfSearchModel::setSearchString(QString searchString)
+void QPdfSearchModel::setSearchString(const QString &searchString)
{
Q_D(QPdfSearchModel);
if (d->searchString == searchString)
diff --git a/src/pdf/qpdfsearchmodel.h b/src/pdf/qpdfsearchmodel.h
index 5e7ea586f..a4e35fd04 100644
--- a/src/pdf/qpdfsearchmodel.h
+++ b/src/pdf/qpdfsearchmodel.h
@@ -80,7 +80,7 @@ public:
QVariant data(const QModelIndex &index, int role) const override;
public Q_SLOTS:
- void setSearchString(QString searchString);
+ void setSearchString(const QString &searchString);
void setDocument(QPdfDocument *document);
Q_SIGNALS: