diff options
author | Liang Qi <liang.qi@qt.io> | 2017-02-24 19:57:17 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-02-24 20:01:42 +0100 |
commit | de49839df8abfba1f3ed3c36ef3177e4a9d6ef00 (patch) | |
tree | 71e777ca1e33c58edd9149821e970495ef4b75b2 /src/corelib/plugin/qfactoryloader_p.h | |
parent | e6234535929c67e7fbfa1ad7ce88f37df0b68d45 (diff) | |
parent | 4d3781b640e8fb0a04e96b2d05199247556b8d86 (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
mkspecs/features/moc.prf
Change-Id: Ia71c8e3b3185f7c999bf226d0675051b10b8740b
Diffstat (limited to 'src/corelib/plugin/qfactoryloader_p.h')
-rw-r--r-- | src/corelib/plugin/qfactoryloader_p.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/plugin/qfactoryloader_p.h b/src/corelib/plugin/qfactoryloader_p.h index 0876d141c4..70a934c976 100644 --- a/src/corelib/plugin/qfactoryloader_p.h +++ b/src/corelib/plugin/qfactoryloader_p.h @@ -57,11 +57,22 @@ #include "QtCore/qobject.h" #include "QtCore/qstringlist.h" #include "QtCore/qjsonobject.h" +#include "QtCore/qjsondocument.h" #include "QtCore/qmap.h" +#include "QtCore/qendian.h" #include "private/qlibrary_p.h" QT_BEGIN_NAMESPACE +inline QJsonDocument qJsonFromRawLibraryMetaData(const char *raw) +{ + raw += strlen("QTMETADATA "); + // the size of the embedded JSON object can be found 8 bytes into the data (see qjson_p.h), + // but doesn't include the size of the header (8 bytes) + QByteArray json(raw, qFromLittleEndian<uint>(*(const uint *)(raw + 8)) + 8); + return QJsonDocument::fromBinaryData(json); +} + class QFactoryLoaderPrivate; class Q_CORE_EXPORT QFactoryLoader : public QObject { |