Hi!
In the meantime I have found a solution:
import QtQuick 2.2
import QtQuick.Controls 1.1
Rectangle {
id: main
width: 360
height: 360
BusyIndicator {
id: indicator
anchors.centerIn: parent
running: false
}
MouseArea {
anchors.fill: parent
onClicked: {
indicator.running = true
timer.start()
}
}
Timer {
id: timer
repeat: false
onTriggered: fct()
}
function fct(){
console.log(fib(35))
indicator.running = false
}
function fib(n){
if (n === 0 || n === 1){
return 1
} else {
return fib(n-1) + fib(n-2)
}
}
}
Best regards, Oliver.
↧