[Kde-bindings] Ruby: various DBus int variants

Richard Dale richard.dale at telefonica.net
Tue Aug 3 12:53:41 UTC 2010


On Tuesday, August 03, 2010 01:41:02 pm Arno Rehn wrote:
> On Sunday 01 August 2010 21:23:20 Sylvain Sauvage wrote:
> > Hi all,
> > 
> > DBus integers can be 16, 32, or 64 bits, signed or unsigned, but
> > I can’t find a way to make a matching Qt::Variant in Ruby (for
> > DBus arguments are Qt::Variants).
> > 
> > In the 2006-12-04 entry of qtruby Changelog, it reads:
> >   1095  * Add an option extra argument to Qt::Variant.fromValue() and
> >   1096  qVariantFromValue
> >   1097            to specify a type string, for use with QtDBus args. For
> > 
> > example: 1098
> > 
> >   1099                  v = Qt::Variant.fromValue(5, "uint")
> >   1100
> >   1101            Will force the Qt::Variant to be a specific type
> > 
> > (line numbers from June 22th’s version (websvn)).
> > 
> > But it doesn’t work anymore:
> > Qt::Variant.fromValue( 0, 'uint' )
> > => #<Qt::Variant:0x7f3a5b86bdb0 typeName=int>
> > 
> > Is there a new way?
> 
> The type name has changed to 'unsigned int' - however it then crashes. Have
> to investigate that.
It should be the same as whatever QVariant::typeName() returns for the type 
which I expect is still "uint". But ideally it shouldn't crash.

-- Richard



More information about the Kde-bindings mailing list