Qt中动态和显示加在库的方法

QString libpath=QString(HomePath)+QDir::separator()+"com_dll"+QDir::separator()+"plugins";
QApplication::addLibraryPath ( libpath );

QDir pluginsDir = QDir(path);
//pluginsDir.cd("plugins");
try
{
QString fileName=name;//"MyPluginWidget.dll";
QPluginLoader loader(pluginsDir.absoluteFilePath(fileName));
QObject *plugin = loader.instance();

}

你可能感兴趣的:(qt)