Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Binary Data of QJsonDocument



  • Hi,
    with the toBinarData() function of the QJsonDocument class, I can save the JSON document as a binary file. Is the binary data a specific format like BSON or UBJSON?

    The doc says only:

    It also contains support for saving this data in a binary format that is directly "mmap"-able and very fast to access.

    Thanks



  • Nothing of the sort. toBinarData() just stores the QJsonDocument as it is internally managed by the class. The maintainer of Qt Core advises not to use that method as it will soon be deprecated (source). Stick to toJson()



  • @VRonin
    Thanks!


Log in to reply