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/gui | |
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/gui')
-rw-r--r-- | src/gui/rhi/qshaderdescription.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/rhi/qshaderdescription.cpp b/src/gui/rhi/qshaderdescription.cpp index d0f73f6aa7..7e9b7d7b8e 100644 --- a/src/gui/rhi/qshaderdescription.cpp +++ b/src/gui/rhi/qshaderdescription.cpp @@ -342,8 +342,11 @@ bool QShaderDescription::isValid() const */ QByteArray QShaderDescription::toBinaryJson() const { -#if QT_CONFIG(binaryjson) +#if QT_CONFIG(binaryjson) && QT_DEPRECATED_SINCE(5, 15) +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED return d->makeDoc().toBinaryData(); +QT_WARNING_POP #else qWarning("Cannot generate binary JSON from QShaderDescription due to disabled binaryjson feature"); return QByteArray(); @@ -382,8 +385,11 @@ QByteArray QShaderDescription::toJson() const QShaderDescription QShaderDescription::fromBinaryJson(const QByteArray &data) { QShaderDescription desc; -#if QT_CONFIG(binaryjson) +#if QT_CONFIG(binaryjson) && QT_DEPRECATED_SINCE(5, 15) +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED QShaderDescriptionPrivate::get(&desc)->loadDoc(QJsonDocument::fromBinaryData(data)); +QT_WARNING_POP #else Q_UNUSED(data); qWarning("Cannot load QShaderDescription from binary JSON due to disabled binaryjson feature"); |