scalling an object smoothly over time
Solved
QML and Qt Quick
-
I have a rectangle where it's width increases to reach a certain value within 30 seconds, I wrote this which works fine but it's width increases in pulses ones every second:
Timer{ id: time interval: 1000; running: true; repeat: true onTriggered: rect.width = ((outerRect.width * parseInt(time_val.text))/30) - (time_val.width/2) }
what can I do to make it scale up smoothly?
-
hi @newbisoso
inside your Rectangle write the following:
Behavior on width { NumberAnimation { duration: 1000 } }
-
hi
@newbisoso said in scalling an object smoothly over time:pulses ones every second
that is because you have an interval of 1000ms on the Timer, reducing the interval will make transition smoother
but what @J-Hill suggested is probably more suited.