Important: Please read the Qt Code of Conduct -

Qt5 QJsonDocument vs QJson (sf)

  • In the past I have try (just a little) with, I love the QJson's QObject helper that can dump and restore QObject’s attributes.

    Now In Qt5 I see the but I cannot find any example!
    With the new JSON support in Qt5, can and map my "custom class" to JSON and reserve...easily like QJson?

    Can you send me some example with the new Qt5 Json, thanks!

  • qobjecthelper.h and .cpp only use core classes:
    @#include "qobjecthelper.h"

    #include <QtCore/QMetaObject>
    #include <QtCore/QMetaProperty>
    #include <QtCore/QObject>
    #include <QtCore/QString>@

    So you can do the same thing on Qt 5. Be careful , the original code is under GPL. (not LGPL-like), you can't copy/paste it and do everything with:
    @* Copyright (C) 2009 Till Adam

Log in to reply