PDA

View Full Version : Plugin Loading and Signal Handling in Qt4



liquid
25th January 2008, 06:26
Hi,
Anyone can post a tutorial, which describe how we can load plugins and connect signal and slots from main program to plugin in Qt4.

ashukla
25th January 2008, 06:38
Hi,
Anyone can post a tutorial, which describe how we can load plugins and connect signal and slots from main program to plugin in Qt4.
I think it may help you.
http://doc.trolltech.com/4.3/plugins-howto.html http://doc.trolltech.com/4.3/tools-plugandpaint.html

jpn
25th January 2008, 08:42
A plugin interface cannot declare signals and slots because it cannot inherit QObject. But you can make the plugin interface return an object which provides those signals and slots.

liquid
25th January 2008, 09:43
Thanks.
Can you post a simple example code, which describe how to make a plugin interface, which return an object that provides signals and slots.

jpn
25th January 2008, 09:53
class PluginInterface
{
public:
virtual ~PluginInterface() {}
virtual QObject* someObjectWithSignalsAndSlots() const = 0; // <--
...
};

Q_DECLARE_INTERFACE(...)