summaryrefslogtreecommitdiffstats
path: root/qmake/library/proitems.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-04-07 17:10:37 +0200
committerMarc Mutz <marc.mutz@kdab.com>2017-04-07 18:33:23 +0000
commitf5d8ad61a4c85a656a7332c43d0c42f5eaf43593 (patch)
treebf93534787a360d5e34b5abe59540f1446983429 /qmake/library/proitems.h
parentcdbe9d1483b0761c9b5e72cc56dacf09d1b54118 (diff)
qmake: use new QString::arg(QStringView) overload
Add ProString::toQStringView() to avoid creating QStrings just to pass them to QString::arg() (single-arg; multiArg() does not, yet, accept QStringViews). I could have used the existing toQStringRef() function, but QStringRef is a tad more complex to copy and quite a bit less future-proof. Change-Id: I344c46f301768e844c487d36ce3e6cb276de8843 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'qmake/library/proitems.h')
-rw-r--r--qmake/library/proitems.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h
index c81e205699..40fc23ed19 100644
--- a/qmake/library/proitems.h
+++ b/qmake/library/proitems.h
@@ -139,6 +139,7 @@ public:
static uint hash(const QChar *p, int n);
ALWAYS_INLINE QStringRef toQStringRef() const { return QStringRef(&m_string, m_offset, m_length); }
+ ALWAYS_INLINE QStringView toQStringView() const { return QStringView(m_string).mid(m_offset, m_length); }
ALWAYS_INLINE ProKey &toKey() { return *(ProKey *)this; }
ALWAYS_INLINE const ProKey &toKey() const { return *(const ProKey *)this; }