diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-06-19 13:29:55 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-08-18 19:59:46 +0000 |
commit | 6c76fdc7616ac3b62c5750600bd6d5985dbceb20 (patch) | |
tree | 5f8ec6d8b0b444d07d9fe3780acf77996157c890 /src/corelib/plugin/qfactoryloader_p.h | |
parent | 1f437e7540cbdfca8adcad0b69ae26237846ab23 (diff) |
Allow loading of static plugins if QT_NO_LIBRARY is set.
We keep two symbols from QPluginLoader defined, even if QT_NO_LIBRARY
is set in order to be able to locate static plugins. This doesn't
constitute any loading of shared libraries or plugins from external
files at runtime.
Using these symbols we can enable most of QFactoryLoader even if
QT_NO_LIBRARY is set. Only update(), refreshAll(), library() and
the dtor make no sense then. This way QGenericPlugin also becomes
useful with QT_NO_LIBRARY.
Task-number: QTBUG-3045
Change-Id: Ib7842ce5799e8e2caa46431d95fddd1adda0fc41
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/plugin/qfactoryloader_p.h')
-rw-r--r-- | src/corelib/plugin/qfactoryloader_p.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/corelib/plugin/qfactoryloader_p.h b/src/corelib/plugin/qfactoryloader_p.h index 1c48491b0d..ee07084180 100644 --- a/src/corelib/plugin/qfactoryloader_p.h +++ b/src/corelib/plugin/qfactoryloader_p.h @@ -45,17 +45,18 @@ // We mean it. // +#include "QtCore/qglobal.h" +#ifndef QT_NO_QOBJECT + #include "QtCore/qobject.h" #include "QtCore/qstringlist.h" #include "QtCore/qjsonobject.h" #include "QtCore/qmap.h" #include "private/qlibrary_p.h" -#ifndef QT_NO_LIBRARY QT_BEGIN_NAMESPACE class QFactoryLoaderPrivate; - class Q_CORE_EXPORT QFactoryLoader : public QObject { Q_OBJECT @@ -65,21 +66,23 @@ public: explicit QFactoryLoader(const char *iid, const QString &suffix = QString(), Qt::CaseSensitivity = Qt::CaseSensitive); + +#ifndef QT_NO_LIBRARY ~QFactoryLoader(); - QList<QJsonObject> metaData() const; - QObject *instance(int index) const; + void update(); + static void refreshAll(); #if defined(Q_OS_UNIX) && !defined (Q_OS_MAC) QLibraryPrivate *library(const QString &key) const; -#endif +#endif // Q_OS_UNIX && !Q_OS_MAC +#endif // !QT_NO_LIBRARY QMultiMap<int, QString> keyMap() const; int indexOf(const QString &needle) const; - void update(); - - static void refreshAll(); + QList<QJsonObject> metaData() const; + QObject *instance(int index) const; }; template <class PluginInterface, class FactoryInterface> @@ -112,6 +115,6 @@ PluginInterface *qLoadPlugin1(const QFactoryLoader *loader, QT_END_NAMESPACE -#endif // QT_NO_LIBRARY +#endif // QT_NO_QOBJECT #endif // QFACTORYLOADER_P_H |