I don't think you can construct a QVariant _of_ an arbitrary object, but you can store most objects in QVariants as pickled strings:

a=[1,2,3,4]
v=QtCore.QVariant(pickle.dumps(a))
pickle.loads(str(v.toString()))
[1, 2, 3, 4]

This may or may not be what you are looking for...

 ~ Akos.


Arve Knudsen wrote:
How do I construct a QVariant of an object of a non-Qt class?

Thanks,
Arve

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to