[PyKDE] PyQt4's QVariant returns tuples?

Andreas Pakulat apaku at gmx.de
Tue Dec 27 19:01:22 GMT 2005


does somebody know why QVariant.to* returns tuples when asking for
simple datatypes, like int and double?

AFAICS it returns the value and wether the conversion was successful, is
this intended behaviour? Documented somewhere? Should I always use

variant.toInt()[0] to get to the int?

To me it seems a bit inconsistent, some of the to* functions return only
the data, some return a tuple and it's definitely not like Qt itself
handles the to* functions.


You will be winged by an anti-aircraft battery.

More information about the PyQt mailing list