summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qlibrary_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/plugin/qlibrary_p.h')
-rw-r--r--src/corelib/plugin/qlibrary_p.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h
index ada90d7bfd..11b0cb1eb9 100644
--- a/src/corelib/plugin/qlibrary_p.h
+++ b/src/corelib/plugin/qlibrary_p.h
@@ -57,9 +57,20 @@
# include "QtCore/qt_windows.h"
#endif
+QT_BEGIN_NAMESPACE
+
+// Needed also in case of QT_NO_LIBRARY, for static plugin loading.
+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);
+}
+
#ifndef QT_NO_LIBRARY
-QT_BEGIN_NAMESPACE
bool qt_debug_component();
@@ -104,14 +115,6 @@ public:
void updatePluginState();
bool isPlugin();
- static inline QJsonDocument fromRawMetaData(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);
- }
-
private:
explicit QLibraryPrivate(const QString &canonicalFileName, const QString &version, QLibrary::LoadHints loadHints);
~QLibraryPrivate();
@@ -132,8 +135,8 @@ private:
friend class QLibraryStore;
};
-QT_END_NAMESPACE
-
#endif // QT_NO_LIBRARY
+QT_END_NAMESPACE
+
#endif // QLIBRARY_P_H