[Qt-interest] Inheriting slots in plugins?

Anatoly Burakov burakov.anatoly at gmail.com
Tue Jun 22 16:57:59 CEST 2010


Hi all

I am developing a plugin-based application. I do NOT use QPluginLoader,
i use QLibrary::resolve and standard export methods (e.g.
__declspec(dllexport)  and extern "C" blahblahblah).

I inherit my objects just fine, they work OK, they load etc. so no
problem there - the code works.

I want every plugin to have certain slots, and i want the main
application to know about them, so i do the sensible thing and put them
in my plugin interface code. The slots don't work if i don't put the
Q_OBJECT macro in an interface code (the interface itself inherits QOBject).

The plugins in turn won't load (using QLibrary) if i put Q_OBJECT macro
in my interface. The QLibrary::errorString() returns something along the
lines of "Cannot load library clientplugins/libPrintPlugin.so.1.0.0:
(clientplugins/libPrintPlugin.so.1.0.0.so: cannot open shared object
file: No such file or directory). Haven't tried it on Windows yet but i
remember having similar problems on Windows too. Trying to load the
library directly (using a QFileDialo::getOpenFileName) results in error
that looks like "Cannot load library
***somepath***/unix-bin/clientplugins/libPrintPlugin.so.1.0.0:
(**somepath***/unix-bin/clientplugins/libPrintPlugin.so.1.0.0: undefined
symbol: _ZN13IWindowPlugin16staticMetaObjectE)".

What can i do? Will QPluginLoader help me with this?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5238 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100622/df5e3fe0/attachment.bin 


More information about the Qt-interest-old mailing list