Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

use a function in qml from another qml

$
0
0
Hello, i want to use an function in qml what is written in an other qml file, but it won’t work the example the function is written in the file “function.qml” in an seperate directory called components the function looks like this function assign(id) { value = id + 20 return: value; } now i work in another qml file it looks like that. import “components/” property int test: function.assign(number) if i now run the qml I got an message in the qml-log “ReferenceError: Can’t find variable: function” i don’t understand it. have someone an idea? if i wrote the function in the same file it work. can i call a function like this? NOTE: this is just an example for the function

Viewing all articles
Browse latest Browse all 4972

Trending Articles