So, PySide2 has removed the QVariant* types.
However, QtQuick expose a great deal of QVariant API.
More specifically, i want to use the very handy feature to pass a QVariantList as a model of ListView without having to implement a fully blown QAIM.
However, by feeding such an object to QML via setContextProperty
class Test(QObject):
def __init__(self):
super(Test, self).__init__()
self.propertyList = ["FOO", "BAR", 1]
def model(self):
return self.propertyList
modelChanged = Signal()
model = Property(list, model, notify=modelChanged)
And then printing .model yields:
qml: QVariant(PySide::PyObjectWrapper)
So how to pass a python list to qml in a form that is actually understood by qml?