diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2020-01-08 13:43:54 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2020-01-09 13:52:25 +0100 |
commit | 89c4bb5f2473b4616fdccbcc616eedfaa5d628cc (patch) | |
tree | 8642b5ed9250c4c3753fc5a45379dd1a95f878e0 /src/corelib/serialization/qjsondocument.cpp | |
parent | bfbf8ca4536fda39a8fb34dbf149794437f68dff (diff) |
Deprecate QJsonDocument methods for converting to/from JSON binary
Also remove the example code for deprecated methods and use CBOR instead
where it makes sense.
Task-number: QTBUG-81068
Change-Id: Iffb7a4b3d7b16a1e485fc05b3ab2e2468e9e0718
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/corelib/serialization/qjsondocument.cpp')
-rw-r--r-- | src/corelib/serialization/qjsondocument.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/serialization/qjsondocument.cpp b/src/corelib/serialization/qjsondocument.cpp index b9b1902f34..fe0500bdef 100644 --- a/src/corelib/serialization/qjsondocument.cpp +++ b/src/corelib/serialization/qjsondocument.cpp @@ -237,7 +237,7 @@ QJsonDocument &QJsonDocument::operator =(const QJsonDocument &other) the application. */ -#if QT_CONFIG(binaryjson) +#if QT_CONFIG(binaryjson) && QT_DEPRECATED_SINCE(5, 15) /*! Creates a QJsonDocument that uses the first \a size bytes from \a data. It assumes \a data contains a binary encoded JSON document. @@ -385,10 +385,13 @@ QJsonDocument QJsonDocument::fromBinaryData(const QByteArray &data, DataValidati QByteArray QJsonDocument::toBinaryData() const { int size = 0; +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED const char *raw = rawData(&size); +QT_WARNING_POP return QByteArray(raw, size); } -#endif // QT_CONFIG(binaryjson) +#endif // QT_CONFIG(binaryjson) && QT_DEPRECATED_SINCE(5, 15) /*! Creates a QJsonDocument from the QVariant \a variant. |