diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-03-14 15:36:50 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-14 21:46:55 +0100 |
commit | 2c944d6b9dd7d750835cca491aac60825cd7d1ed (patch) | |
tree | 9abf4665ae39d7f3945341bd69fc7824d824f754 /src/corelib/tools/qstring.h | |
parent | ded80cfc8a3f258a85954b4fd19063f9988f3744 (diff) |
Add QByteArray overload for the QLatin1String ctor.
This increases source compatibility when QT_NO_CAST_FROM_BYTEARRAY
is used.
Change-Id: Ie1a1cfa8acac2fa91aa8f217d91e22289be8b38f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qstring.h')
-rw-r--r-- | src/corelib/tools/qstring.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 26959d81f3..b71484f4cb 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -647,6 +647,7 @@ class QLatin1String public: Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s) : m_size(s ? int(strlen(s)) : 0), m_data(s) {} Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s, int sz) : m_size(sz), m_data(s) {} + Q_DECL_CONSTEXPR inline explicit QLatin1String(const QByteArray &s) : m_size(strlen(s.constData())), m_data(s.constData()) {} inline const char *latin1() const { return m_data; } inline int size() const { return m_size; } |