DataEngine & KPluginFactory

Kevin Krammer krammer at kde.org
Mon Jul 1 07:03:29 UTC 2013


On Monday, 2013-07-01, Sebastian Kügler wrote:

> Open questions:
> 
> - KPart and QWidget create* calls: In my current patch, these are simply
>   ignored.
>   I'm getting away with one overridden function in our
>   macro-generated KPluginFactory subclass, it all seems to boil down to
> 
> 	virtual QObject *create(const char *iface, QWidget *parentWidget, \
> 									QObject *parent, const QVariantList &args, 
\
> 									const QString &keyword) \
>         { \
>             return new baseclass(parent, args); \
>         } \
> 
>   as you can see, I'm using "baseclass" as return type. Is there a way to
> use iface for the classname? If so, then this could be moved into an
> inline method?

What if the macro only creates the header content (as its name already 
suggests)?

name::create() could then be implemented in a plugin specific way, not 
requiring a certain constructor pattern or specifying of "baseclass".

It would also allow to just pass parent, not also parentWidget. A plugin that 
creates a widget can qobject_cast parent to QWidget.

Cheers,
Kevin
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130701/45c30a64/attachment.sig>


More information about the Kde-frameworks-devel mailing list