javascript - QtQuick Gauge Needle rotation animation is not smooth -
i trying create simple gauge using qtquick. problem facing needle rotation not smooth. when needle angle changed higher value needle not moving smoothly, there jerk in motion , feel multiple needle moving. tried use of animations types , easing types available result negative.
main.qml
import qtquick 2.0 rectangle { visible: true width: 800 height: 800 color: "#00000000" // needle rectangle{ id: id_needle x: 350 y: 350 width: 300 height: 5 color: "red" antialiasing: true smooth: true transform: rotation { id: rotation origin.x: 3 origin.y: 3 angle: 0 behavior on angle { numberanimation{ duration: 1500 easing.type: easing.outquad } } } } // sample timer update needle angle timer{ id: tim repeat: true running: true interval: 2000 ontriggered: { var data = math.floor(math.random() * 360) + 0 rotation.angle = data } } }
Comments
Post a Comment