diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-20 01:01:00 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-02-20 09:51:12 +0100 |
commit | 035f934d7a798e97bf0213a5d42a3d511132f03d (patch) | |
tree | 89aa6efdc86864ce479cddca6b9c4ba523c2754a /src/corelib/serialization/qcborvalue.cpp | |
parent | f4cc23cffbe3005f0a522cac938695e87ecd6407 (diff) | |
parent | da4ab444ffac37514435364d4d3f0ad59d4f9bc3 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
Added tests/auto/testlib/selftests/expected_crashes_5.txt to work
round the output of the crashes test (which exercises UB, see
QTBUG-73903) being truncated on one test platform.
Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
Diffstat (limited to 'src/corelib/serialization/qcborvalue.cpp')
-rw-r--r-- | src/corelib/serialization/qcborvalue.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp index 9e8c98837c..288446878c 100644 --- a/src/corelib/serialization/qcborvalue.cpp +++ b/src/corelib/serialization/qcborvalue.cpp @@ -108,7 +108,7 @@ QT_BEGIN_NAMESPACE QCborValue can contain a value of "null", which is not of any specific type. It resembles the C++ \c {std::nullptr_t} type, whose only possible value is - \c nullptr. QCborValue has a constructor taking such a type and creates a + \nullptr. QCborValue has a constructor taking such a type and creates a null QCborValue. Null values are used to indicate that an optional value is not present. In @@ -417,7 +417,7 @@ QT_BEGIN_NAMESPACE using toSimpleType() as well as isSimpleType(st). CBOR simple types are types that do not have any associated value, like - C++'s \c{std::nullptr_t} type, whose only possible value is \c nullptr. + C++'s \c{std::nullptr_t} type, whose only possible value is \nullptr. If \a st is \c{QCborSimpleType::Null}, the resulting QCborValue will be of the \l{Type}{Null} type and similarly for \c{QCborSimpleType::Undefined}. @@ -1772,6 +1772,7 @@ QCborValue::QCborValue(const QUrl &url) container->elements[1].type = String; } +#if QT_CONFIG(regularexpression) /*! Creates a QCborValue object of the regular expression pattern extended type and containing the value represented by \a rx. The value can later be retrieved @@ -1790,6 +1791,7 @@ QCborValue::QCborValue(const QRegularExpression &rx) // change type t = RegularExpression; } +#endif // QT_CONFIG(regularexpression) /*! Creates a QCborValue object of the UUID extended type and containing the @@ -1943,6 +1945,7 @@ QUrl QCborValue::toUrl(const QUrl &defaultValue) const return QUrl::fromEncoded(byteData->asByteArrayView()); } +#if QT_CONFIG(regularexpression) /*! Returns the regular expression value stored in this QCborValue, if it is of the regular expression pattern extended type. Otherwise, it returns \a @@ -1961,6 +1964,7 @@ QRegularExpression QCborValue::toRegularExpression(const QRegularExpression &def Q_ASSERT(n == -1); return QRegularExpression(container->stringAt(1)); } +#endif // QT_CONFIG(regularexpression) /*! Returns the UUID value stored in this QCborValue, if it is of the UUID @@ -2870,12 +2874,16 @@ uint qHash(const QCborValue &value, uint seed) return qHash(value.toDateTime(), seed); case QCborValue::Url: return qHash(value.toUrl(), seed); +#if QT_CONFIG(regularexpression) case QCborValue::RegularExpression: return qHash(value.toRegularExpression(), seed); +#endif case QCborValue::Uuid: return qHash(value.toUuid(), seed); case QCborValue::Invalid: return seed; + default: + break; } Q_ASSERT(value.isSimpleType()); @@ -2920,12 +2928,16 @@ static QDebug debugContents(QDebug &dbg, const QCborValue &v) return dbg << v.toDateTime(); case QCborValue::Url: return dbg << v.toUrl(); +#if QT_CONFIG(regularexpression) case QCborValue::RegularExpression: return dbg << v.toRegularExpression(); +#endif case QCborValue::Uuid: return dbg << v.toUuid(); case QCborValue::Invalid: return dbg << "<invalid>"; + default: + break; } if (v.isSimpleType()) return dbg << v.toSimpleType(); |