关于Qt动态加载dll的问题
#include <QtGui/QApplication>#include <QtGui/QWidget>
#include <QLibrary>
#include <Qt/qstring.h>
#include "PracDll.h"
typedef void (*my_SetupUi)(QWidget *);
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
#ifdef Q_OS_WIN
typedef void (*my_SetupUi)(QWidget *);
my_SetupUi test;
QString str = "PracDll.dll";
QLibrary lib(str);
test = (my_SetupUi)lib.resolve("setupUi");
QWidget *q = new QWidget();
test(q);
q->show();
lib.unload();
#endif
return app.exec();
}