ahmed
ahmed

Reputation: 41

what is the format for saving a qml QVariantList<QVariant> in qml file so it can be bindable in qml when loading the file?

i am doing an application and i need to save the QVariantList list in a qml file so i can load it in qml every time i start the application

to make it more clear i read qpoints from qml and store them in a qvariantlist in c++ so the next step is to save it in text file i use the format(that's how i write it to file.qml)

import ARHandbook 1.0;
x:["1 2" , "1 3"] 

but it doesnt load in qml so what is the right format to store it with ? it gives this error unable to assin qvariantlist to void

Upvotes: 2

Views: 667

Answers (1)

coredump
coredump

Reputation: 56

For QtQuick 1.x, you should use property variant type, from QtQuick 2.0, you can just use property var to store array types.

See http://doc-snapshot.qt-project.org/5.0/qml-var.html and http://qt-project.org/doc/qt-4.8/qml-variant.html for details.

Upvotes: 2

Related Questions