Hello all,
Please consider the following mock-up of how my application works:
Qt Code:
class DataSource { public: }; { Q_OBJECT public: void setDataSource(DataSource* ds) { this->ds = ds; } protected: DataSource* ds; }; class SomeWidget : public BaseWidget { public: { // do some custom drawing using ds->dataForKey() // with specific "key" parameter } };To copy to clipboard, switch view to plain text mode
My application has a repertoire of subclasses of BaseWidget that I would like to dynamically extend through plugins. Qt's documentation is quite clear on the basics, but covers only the case where the plugin can be implemented exclusively with pure Qt facilities. In this case, I would like the plug-in to be able to access my custom facilities, i.e. the DataSource mechanism in the mock-up above.
I'm not sure how to proceed toward the implementation of such a setup. How can I provide the plugins with access to facilities sitting in the main application? Should I put these facilities in a separate dynamic library against which both the application and the plugins will be linked? Or is there a potentially simpler way to achieve this?
Thanks in advance for your help,
Antoine
Bookmarks