#ifndef __PLUGINLOADER_H__ #define __PLUGINLOADER_H__ #include #include #include class PluginLoader : public QObject { Q_OBJECT public: explicit PluginLoader(QString fileName, QObject *parent = nullptr); ~PluginLoader(); bool load(); bool unload(); bool isLoaded() const; const QObject* instance(); QString fileName() const; QString errorString() const; QList customWidgets() const; private: QPluginLoader *m_pLoader; QList m_customWidgets; // 插件控件列表 }; #endif // PLUGINLOADER_H