summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qcbormap.h
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-10-09 01:00:47 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-10-09 01:00:48 +0200
commit69b6845edbb43cf7000942d07f3a326383bdf6d2 (patch)
tree58755c33dfb18a51d194d0f774b1deca6135ce4a /src/corelib/serialization/qcbormap.h
parente2ab24d36f31395c2239b49ac26f2266b69444bd (diff)
parent8e5a2f63c3f6ee49d3f2e1985bf73de7769b0e72 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Diffstat (limited to 'src/corelib/serialization/qcbormap.h')
-rw-r--r--src/corelib/serialization/qcbormap.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/corelib/serialization/qcbormap.h b/src/corelib/serialization/qcbormap.h
index 866b7cd743..0eb163a0a8 100644
--- a/src/corelib/serialization/qcbormap.h
+++ b/src/corelib/serialization/qcbormap.h
@@ -196,14 +196,22 @@ public:
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
QCborValue value(const QCborValue &key) const
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
- QCborValue operator[](qint64 key) const
+#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
+ template<size_t N> QT_ASCII_CAST_WARN const QCborValue value(const char (&key)[N]) const
+ { return value(QString::fromUtf8(key, N - 1)); }
+#endif
+ const QCborValue operator[](qint64 key) const
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
- QCborValue operator[](QLatin1String key) const
+ const QCborValue operator[](QLatin1String key) const
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
- QCborValue operator[](const QString & key) const
+ const QCborValue operator[](const QString & key) const
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
- QCborValue operator[](const QCborValue &key) const
+ const QCborValue operator[](const QCborValue &key) const
{ const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); }
+#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
+ template<size_t N> QT_ASCII_CAST_WARN const QCborValue operator[](const char (&key)[N]) const
+ { return operator[](QString::fromUtf8(key, N - 1)); }
+#endif
QCborValueRef operator[](qint64 key);
QCborValueRef operator[](QLatin1String key);
QCborValueRef operator[](const QString & key);