summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.h
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2021-06-10 16:52:17 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2021-06-12 03:08:59 +0200
commite0ae1af278f3cc6df6c3f66e4118585cc8384b15 (patch)
treed18ecb98ef82d006dc67ef9e914e756e92b83424 /src/corelib/text/qstring.h
parent77d62727d0c1c638b904ada8fc720de2a4d60a6e (diff)
QLatin1String: Add a constructor taking QByteArrayView
Change-Id: Ie90645486431d7af3fe8128417b0fb6bd02a88b5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstring.h')
-rw-r--r--src/corelib/text/qstring.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h
index e17bcbfbf6..cce57cd578 100644
--- a/src/corelib/text/qstring.h
+++ b/src/corelib/text/qstring.h
@@ -89,6 +89,7 @@ public:
: QLatin1String(f, qsizetype(l - f)) {}
constexpr inline explicit QLatin1String(const char *s, qsizetype sz) noexcept : m_size(sz), m_data(s) {}
explicit QLatin1String(const QByteArray &s) noexcept : m_size(qsizetype(qstrnlen(s.constData(), s.size()))), m_data(s.constData()) {}
+ constexpr explicit QLatin1String(QByteArrayView s) noexcept : m_size(s.size()), m_data(s.data()) {}
inline QString toString() const;