[Kde-bindings] Re: Custom properties on QObjects defined in qtruby

Arno Rehn arno at arnorehn.de
Thu Apr 14 19:58:31 UTC 2011


On Thursday 14 April 2011 21:55:24 Sven Moritz Hallberg wrote:
> On 04/13/2011 08:17 PM, Sven Moritz Hallberg wrote:
> > [ruby] qt_readprop(0 "stuff") -> "ho"         # ReadProperty called
> > and... [ruby] qt_readprop(0 "stuff") -> "ho"         # ...returning
> > correct value [qml]   stuff:                                # still,
> > empty!?
> > 
> > maybe you have an idea which piece is missing... otherwise i'll do some
> > more investigating...
> 
> got it, i remembered that QML wants all properties to be of QVariant type.
> duh! now, declaring
> 
>     properties 'QVariant stuff READ getStuff WRITE changeStuff NOTIFY
> stuffChanged'
> 
> works as intended!
> 
> 
> because the READ/WRITE/NOTIFY stuff looks pretty generic, i'm thinking
> about adding a simple variant
> 
>     properties :stuff
> 
> that would define suitable READ/WRITE methods and a NOTIFY signal. do you
> think that would be a good idea or should it be a seperate function?
I'd add both possibilities. But maybe name the getter and setter methods 
'stuff' and 'stuff=' respectively, to comply with Ruby coding conventions.

Great work btw, you rock! :)

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list