[Kde-bindings] Problem in QtRuby invoking slots with arg types that are typedefs

Richard Dale rdale at foton.es
Mon Feb 22 17:48:01 UTC 2010

On Monday 22 February 2010 05:05:08 pm Arno Rehn wrote:
> On Sunday 21 February 2010 22:32:39 Richard Dale wrote:
> > I was trying to get a plasma ruby applet example working with a
> > 'dataUpdated(QString, Plasma::DataEngine::Data)' slot. However, it
> > doesn't work because smokegen resolves the typedef for DataEngine::Data
> > to const QHash<QString,QVariant>&. So the the data arg is marshalled
> > it's type isn't found in the Smoke lib and I get an error:
> > 
> > /home/rdale/kde/src/4/kdeexamples/plasma/ruby/applets/blinker/contents/co
> > de /main.rb:19:in `qt_metacall': Cannot handle 'Plasma::DataEngine::Data'
> > as slot argument (ArgumentError)
> > 
> > I think Qyoto works the same way and it will probably have the same
> > problem. I haven't worked out the best way of fixing this - it is quite
> > hard because the Smoke lib doesn't have any trace of DataEngine::Data to
> > know what it is.
> Hm, I can think of two possibilities here: Either simply add a
> DataEngine::Data marshaller to the plasma bindings 
That won't work because the string for the type name to retrieve a marshaller 
function is obtained from a smoke type, and if there is no entry in 
Smoke::Type types[], then I get an error like the one above. 

The best solution I can think of is to add extra entries for arg types in the 
types[] array for typedef'd things in slot and signal args that aren't already 
there. They wouldn't be used by any actual arguments to methods, but they 
would make it possible to add a marshaller for something like 
'Plasma::DataEngine::Data' - they would be something for idType() to find.

> or add another table or
> field to smoke which links typedefs in signal/slot signatures to their real
> type. The latter is probably better in terms of maintainability, but it
> could require another BIC change, depending on how we do the 'link'.
Yes, maybe it would be nice to cater for typedefs properly but I don't think 
we can afford a BIC change at the moment.

-- Richard

More information about the Kde-bindings mailing list