[Kde-bindings] Re: qtruby: problem communicating ruby-defined objects via properties

Arno Rehn arno at arnorehn.de
Wed Jun 1 18:14:07 UTC 2011


On Wednesday 01 June 2011 20:06:55 Richard Dale wrote:
> On Wednesday, June 01, 2011 06:26:37 PM Sven Moritz Hallberg wrote:
> > On 06/01/2011 04:55 PM, Sven Moritz Hallberg wrote:
> > > On 05/31/2011 10:21 PM, Richard Dale wrote:
> > >>> note foo.bar being printed as QVariant(rObject) instead of Bar.
> > >> 
> > >> I think it needs to be exposed as a QObject or maybe a QObject wrapped
> > >> inside a QVariant. The QML runtime doesn't know anything about about
> > >> rObjects.
> > > 
> > > that's what i figure, too. afaict it should be a QVariant containing
> > > *some* other type than rObject. alas, i'm stumped on what exactly. do
> > > we need to register a type? or is it enough to use something generic?
> > > (QMetaType::QObjectStar maybe?!) and then, how to actually create this
> > > QVariant object? i can't see through the forest of constructors.
> > 
> > solved it! see attached...
> 
> Yes you're right, qvariant_from_value() is wrong. But about a year ago the
> rObject functionality was added, and a lot of other stuff was removed. I
> don't know why that was done and what was trying to be achieved. Using
> 'git blame' it was Arno Rehn that made the change, but it might have been
> from a patch that someone submitted.
Yes, this was a fix for a bug about not being able to use arbitrary ruby 
objects in Qt::Variant. I tested nearly everything to make sure nothing 
breaks, but maybe QObjects slipped through, or some later commit broke it 
again.

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list