Obsolete Members for QBinaryJson
QBinaryJson クラスの以下のメンバーは非推奨となっています。これらは、古いソースコードが動作し続けるように提供されているものです。新しいコードでの使用は強く推奨しません。
関数
(deprecated in 6.12) const char * | toRawData(const QJsonDocument &document, int *size) |
関数のドキュメント
[deprecated in 6.12] const char *QBinaryJson::toRawData(const QJsonDocument &document, int *size)
この関数はバージョン 6.12 以降、非推奨となっています。新しいコードでの使用は強く推奨しません。
代わりにtoBinaryData()を使用してください。
document の生のバイナリ表現を返します。size には、返されたデータのサイズが格納されます。
このメソッドは、例えば、JSONドキュメントをバイナリ形式でファイルにストリーム出力する場合などに役立ちます。
警告: Qt 6では 、Qt 5 とは異なり、呼び出し側が返されたデータの所有権を取得し、不要になった時点で `free() ` を使用して解放する必要があります。メモリを自動的に管理する `QByteArray` 内のバイナリ表現を取得するには、`toBinaryData()` を使用してください。
注: バイナリ JSON エンコーディングは 、下位互換性を維持するためだけに残されています。これはドキュメント化されておらず、エンコード可能な JSON ドキュメントの最大サイズに制限があります。 Qt JSON 型は Qt CBOR 型に変換でき、さらに CBOR バイナリ形式にシリアライズすることも可能です。その逆も同様です。CBOR 形式は、JSON のスーパーセットに対する、明確に定義され、制約の少ないバイナリ表現です。
関連項目: fromRawData()、fromBinaryData()、toBinaryData()、およびQCborValue 。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.