[Solved]QML Var
-
I havn't found a good documentation about vars yet. Is there any documentation that describes functions like push(), reduce() and so on... ?
-
Yes. Just search for "QML basic types".
Variant exists in QtQuick 1 ("link":http://qt-project.org/doc/qt-4.8/qml-variant.html).
QtQuick 2 introduces a better equivalent called var ("link":http://qt-project.org/doc/qt-5.0/qtqml/qml-var.html).
-
Yes but i can't see any documentation about it's functions, that's what i am searching. For example push(), .reduce(), ... .
-
There are no functions. It is a JS variable: it can contain any objects.
-
Note that, you should use "var" instead of "variant".
"QML Basic Type: var":http://qt-project.org/doc/qt-5/qml-var.html
(sorry, I hadn't seen sierdzio's replies when I replied)
-
Well i am using it as an array and it looks like it has some methods.
@property var test: []
function testFunction(){
test.concat()
test.filter()
test.splice()
}@ -
Then you should search for JavaScript array documentation, not "var" docs. "Link":http://www.w3schools.com/jsref/jsref_obj_array.asp.
-
Yes that is what i was searching for, thank you.