Thanks for your response.
I'm sorry for the errors. You are right, but I'm not allowed to paste the whole code.
In MyPlugin constructor, what I meant was:
MyPlugin::MyPlugin()
{
MyWidget* w = new MyWidget();
w->show();
}
MyPlugin::MyPlugin()
{
MyWidget* w = new MyWidget();
w->show();
}
To copy to clipboard, switch view to plain text mode
The resource is used from within the UI. My .pro file looks like this:
TEMPLATE = lib
CONFIG += plugin debug resources
INCLUDEPATH += /path/to #TheInterface.h
HEADERS = MyPlugin.h \
MyWidget.h
SOURCES = MyPlugin.cpp \
MyWidget.cpp
DEPENDPATH += . resources
RESOURCES += resources/resources.qrc
FORMS = mywidget.ui
TARGET = myplugin
TEMPLATE = lib
CONFIG += plugin debug resources
INCLUDEPATH += /path/to #TheInterface.h
HEADERS = MyPlugin.h \
MyWidget.h
SOURCES = MyPlugin.cpp \
MyWidget.cpp
DEPENDPATH += . resources
RESOURCES += resources/resources.qrc
FORMS = mywidget.ui
TARGET = myplugin
To copy to clipboard, switch view to plain text mode
Also, within MyWidget.h, I'm properly doing
#include "ui_mywidget.h"
#include "ui_mywidget.h"
To copy to clipboard, switch view to plain text mode
I tried putting "Q_INIT_RESOURCE( resources )" in MyPlugin constructor, but no image is shown. I did the equivalent to the following:
MyPlugin::MyPlugin()
{
Q_INIT_RESOURCE( resources );
}
MyPlugin::MyPlugin()
{
Q_INIT_RESOURCE( resources );
}
To copy to clipboard, switch view to plain text mode
I did try to change "resources" for something buggy like "resourcesss" and at plugin loading time the error shown was:
... /path/to/my/libmyplugin.so: undefined symbol: _Z26qInitResources_resourcesssv
Any other idea?
Thanks
Bookmarks