Re: Dynamic widget plugin
I think that your plugin can be abstract factory, so the interface can look like this:
Code:
class Interface
{
public:
};
// in plugin:
class Plugin : public Interface
{
/* ... */
};
QWidget * Plugin
::createWidgetForName(const QString & widgetName
) const {
if (name == "WidgetOne")
return new WidgetOne(parent);
if (name == "WidgetTwo")
return new WidgetTwo(parent);
}
In such situation you can only declare that interface and made as many widgets as you want in you plugin shared library. The problem is that all the widgets you get as QWidget so you dont know anything about custom methods etc. So you have to include custom widgets headers in you main application and qobject_cast them.
At least that is what I would do :D when I face your problem.
P.S. Ohh, of course you can also use Property System and interact with widgets with property() and setProperty()