[Kde-bindings] Re: Workaround for DataEngine::Data& slot argument in dataUpdated

Richard Dale richard.dale at telefonica.net
Thu Nov 18 08:35:06 UTC 2010

On Thursday, November 18, 2010 04:29:37 am David Palacio wrote:
> Hi,
> Current problem: Plasmoid method `dataUpdated` cannot be called as slot
> (Cannot handle DataEngine::Data as slot argument).
> Workaround: dataengine.data.diff (attached)
> The type for DataEngine::Data in generated smokedata.cpp is:
> { "const Plasma::DataEngine::Data&", 0, Smoke::t_voidp|Smoke::tf_stack },
> //419
> This is not found by get_moc_arguments since it removes the const prefix
> when searching the type.
> Later, a handler for the type is not found since the name is missing the
> same prefix as above.
> So is the generated type name in smokedata.cpp wrong? Is this workaround
> totally off?
No not totally off. I had a look at this problem a week or two ago and had been 
meaning to mail this mailing list about it. I've attached a patch for smokegen 
which drops const from types which are used in slot args. I didn't commit it, 
as I don't think it is the best way to fix it.

I think we should leave the types as they are in smokegen, but add an extra 
type signature for methods that are slots based on the type signature returned 
by QMetaObject::normalizedSignature().

We could change the way slot arg types are looked up in bindings like QtRuby 
so that they look for const slot types as well as non-const ones, but the 
lookup code is already very complicated and it seemed a bit clunky to do 
everything twice.

-- Richard

-- Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: type_compiler_const.patch
Type: text/x-patch
Size: 853 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20101118/94f2bf89/attachment.patch>

More information about the Kde-bindings mailing list