plugin loading (was: kcmoduleinfo / Plugin linking problem)

Matthias Kretz kretz at
Sun Aug 12 15:47:59 BST 2007

Oh, I forgot to mention that using this interface it's also possible to 
implement a generic factory for scripting languages:

On Sunday 12 August 2007, Matthias Kretz wrote:
>         virtual QObject *createObject(const char *iface, QObject *parent,
> const QVariantList &args, const QString &keyword) {
>             SubFactory *subFactory =
> m_createInstanceHash[iface].value(keyword); if (subFactory) {
>                 return subFactory->createInstance(parent, args);
>             }
>             return 0;
>         }

As createObject is virtual you don't have to use K_REGISTER_PLUGIN in your 
factory but can also reimplement createObject. With this you could e.g. write 
one generic which could be used for any kind of plugin 
interface (so the KCModuleFactory is unnecessary then). Using the iface and 
keyword strings there's enough data to identify the python code to load and 
execute it.

Matthias Kretz (Germany)                            <><
MatthiasKretz at, kretz at,
Matthias.Kretz at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list