On 20.04.2010 18:42, ext Richard Dale wrote:
You can extend QVariants with the Qt metatype system to wrap previously unknown types, and so if you wanted that to work, then maybe types as strings would be easier to make extensible, instead of hard coded method names. Although I suppose you can use meta programming to trap unknown method callls on the QVariant class, and then assume they were type names.
I wonder wouldn't it be possible (and API-wise simpler) to implement this functionality in the planned autoboxing system? You'd just pass your custom datatypes to functions expecting QVariants and the wrapping would take place automatically.
I don't know how difficult this would be to implement in practice, however...
I did start some of this discussion when I was talking about the problem with QtDBus serialization that i'd had with QtRuby where we needed to force a particular C++ type to be in a QVariant like a 'ushort'. I still can't remember if there is anywhere else in the Qt api where you need to do it. If there isn't, maybe it is best to design how to make QtDBus calls look most Pythonic, as opposed to thinking about QVariants.
It's a long time since we discussed this (internally) but I believe then the decision was not to implement QtDBus for PySide at all but instead rely on the dbus-python module for dbus functionality. So, we might be able to avoid the issue altogether...
ma. _______________________________________________ PySide mailing list [email protected] http://lists.openbossa.org/listinfo/pyside
