[Kde-bindings] How does QtRuby do lvalues?

Chris Burel chrisburel at gmail.com
Mon May 11 07:53:19 UTC 2009


> In Ruby this line:
> option.rect = visualRect(labelIndex)
>
> Is actually a call to the method 'rect=()', even though it looks just like an
> assignment directly to a public variable. In the QtRuby runtime 'rect=()' is a
> synonym for 'setRect()', and the setRect method in the Smoke lib gets called.
> So in Perl you would just need to call the setRect() method and it should work
> ok.

Calling setRect did indeed work fine.  But in Perl you can't overload
the = operator, so I'm not sure what I can do except put in my
documentation to use setRect() instead of rect =.



More information about the Kde-bindings mailing list