File indexing completed on 2026-10-01 09:05:20
0001
0002
0003
0004
0005 #ifndef QPLUGINLOADER_H
0006 #define QPLUGINLOADER_H
0007
0008 #include <QtCore/qglobal.h>
0009 #if QT_CONFIG(library)
0010 #include <QtCore/qlibrary.h>
0011 #endif
0012 #include <QtCore/qplugin.h>
0013
0014 QT_BEGIN_NAMESPACE
0015
0016 #if QT_CONFIG(library)
0017
0018 class QLibraryPrivate;
0019 class QJsonObject;
0020
0021 class Q_CORE_EXPORT QPluginLoader : public QObject
0022 {
0023 Q_OBJECT
0024 Q_PROPERTY(QString fileName READ fileName WRITE setFileName)
0025 Q_PROPERTY(QLibrary::LoadHints loadHints READ loadHints WRITE setLoadHints)
0026 public:
0027 explicit QPluginLoader(QObject *parent = nullptr);
0028 explicit QPluginLoader(const QString &fileName, QObject *parent = nullptr);
0029 ~QPluginLoader();
0030
0031 QObject *instance();
0032 QJsonObject metaData() const;
0033
0034 static QObjectList staticInstances();
0035 static QList<QStaticPlugin> staticPlugins();
0036
0037 bool load();
0038 bool unload();
0039 bool isLoaded() const;
0040
0041 void setFileName(const QString &fileName);
0042 QString fileName() const;
0043
0044 QString errorString() const;
0045
0046 void setLoadHints(QLibrary::LoadHints loadHints);
0047 QLibrary::LoadHints loadHints() const;
0048
0049 private:
0050 QLibraryPrivate *d;
0051 bool did_load;
0052 Q_DISABLE_COPY(QPluginLoader)
0053 };
0054
0055 #else
0056
0057 class Q_CORE_EXPORT QPluginLoader
0058 {
0059 public:
0060 static QObjectList staticInstances();
0061 static QList<QStaticPlugin> staticPlugins();
0062 };
0063
0064 #endif
0065
0066 QT_END_NAMESPACE
0067
0068 #endif