import QtQuick 2.1 Canvas { id: canvas implicitWidth: 128 implicitHeight: 128 property real rotation: 0 onRotationChanged: canvas.requestPaint() NumberAnimation on rotation { running: true loops: Animation.Infinite; from: 0; to: 2 * Math.PI; duration: 1500 } onPaint: { var ctx = canvas.getContext("2d"); ctx.reset(); ctx.save(); ctx.translate(canvas.width / 2, canvas.height / 2); ctx.rotate(canvas.rotation) ctx.lineWidth = 13; ctx.strokeStyle = "red"; ctx.beginPath(); ctx.arc(0, 0, 56, 0, 2 * Math.PI, true); ctx.stroke(); ctx.restore(); } }