hmmm.
not sure atm.
I think the problem may be that you are trying to use it before it has been loaded - you need to statically import it, probably using some more qt macros.
Added after 22 minutes:
for example, I got this main to work:
#define QT_STATICPLUGIN
#include <QtPlugin>
#include <QtGui/QApplication>
#include <QPluginLoader>
#include <QMessageBox>
int main(int argc, char *argv[])
{
QPluginLoader loader
("D:\\Code_Libraries\\Qt\\4.6.0-rebuild\\plugins\\designer\\BERTSpinbox.dll");
QObject *plugin
= loader.
instance();
if (plugin) {
msg="yes";
}
else {
msg="no";
}
return a.exec();
}
#define QT_STATICPLUGIN
#include <QtPlugin>
#include <QtGui/QApplication>
#include <QPluginLoader>
#include <QMessageBox>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QPluginLoader loader("D:\\Code_Libraries\\Qt\\4.6.0-rebuild\\plugins\\designer\\BERTSpinbox.dll");
QString msg;
QObject *plugin = loader.instance();
if (plugin) {
msg="yes";
}
else {
msg="no";
}
QMessageBox::information(NULL, "", msg);
return a.exec();
}
To copy to clipboard, switch view to plain text mode
I think you using the plugin in the mainwindow ui means you have to figure out how to link it slightly differently.
Bookmarks