[Qt-interest] Plugin framework
Tim Peeters
thjmpeeters at gmail.com
Wed Nov 25 23:45:42 CET 2009
ok thanks people! I got it to work :)
I forgot to MOC my header files...
I also added the following definitions to my cmake files:
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
Greets,
Tim
PS: I'm really happy that it works now :D
On Tue, Nov 24, 2009 at 14:22, jjDaNiMoTh <jjdanimoth at gmail.com> wrote:
> 2009/11/24 Tim Peeters <thjmpeeters at gmail.com>:
> > Thanks Andreas,
>
> [cut]
> > I don't have the solution yet but I think (hope) that I am slowly getting
> > closer. My guess was that there was an error with my CMake files, but I
> > cannot find proper documentation on whether I need to do something
> special
> > there to make plugins compile properly.
> >
> I don't have tried to compile your code, but I'm pretty sure that it
> isn't a compilation error, but a runtime error.
>
> > Should the plugin interfaces really be interfaces?
>
> Yes (plugin _interfaces_) :D
> > So all functions must be pure virtual?
>
> Sure !
>
> > Or can I implement a couple of functions that I can then use
> > in all subclasses (i.e., plugins)?
> In this case you must have a library that does the common function for
> all plugins.
>
> Could you post also the .pro file? Just for curiosity.
> Also, don't use .load(), see the example: [1] that use
>
> QPluginLoader pluginLoader(pluginDirectory.absoluteFilePath(fileName));
> QObject *plugin = pluginLoader.instance();
> if (plugin) {
> ....
>
>
> [1]
> http://doc.trolltech.com/4.3/tools-echoplugin-echowindow-echowindow-cpp.html
>
> --
> Key Fingerprint
> 4588 F931 A6E7 C7D5 A302 3064 12EB E87F 9B28 A9D2
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091125/63bc96e2/attachment.html
More information about the Qt-interest-old
mailing list