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

Richard Dale richard.dale at telefonica.net
Wed Jun 1 18:06:55 UTC 2011


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. Please find attached my version of 
qvariant_from_value() - it doesn't work the same way as your fix and actually 
crashes. So we need to find out the reason for the rObject change, and come up 
with a solution that works at least as well as qtruby did a year ago.

-- Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qvariant_from_value.patch
Type: text/x-patch
Size: 6486 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20110601/00cbaa9f/attachment.patch>


More information about the Kde-bindings mailing list