summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-03-31 12:47:33 +0200
committerMarc Mutz <marc.mutz@kdab.com>2017-04-06 12:06:18 +0000
commite1e6506c8dec6d0fc0fdbb15cfde43e7c0277403 (patch)
treee9e3602783a576ca9c8d1e867098fd2024677635 /src/corelib/tools/qstring.h
parent0a5b6106799b25cfd1ab9de2e74098e99a8b13cb (diff)
QString: add QStringView/QLatin1String overload of (non-multi) arg()
Use the new overload directly in QXmlStream*. Saves 129B in QtCore text size on optimized GCC 6.1 Linux AMD64 builds, even though we added two more functions. [ChangeLog][QtCore][QString] Added arg(QStringView), arg(QLatin1String) overloads. Change-Id: Idf7236dcab763824593f34182e4e0b16b5ed4321 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/tools/qstring.h')
-rw-r--r--src/corelib/tools/qstring.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 5110487889..87e88d74bd 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -319,8 +319,14 @@ public:
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(QChar a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
+#if QT_STRINGVIEW_LEVEL < 2
QString arg(const QString &a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
+#endif
+ QString arg(QStringView a, int fieldWidth = 0,
+ QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
+ QString arg(QLatin1String a, int fieldWidth = 0,
+ QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,