Canvas / Context2D in Qt4.8
Unsolved
QML and Qt Quick
-
Hi,
What are you trying to do ?
-
Something like this:
Canvas { id: canvas anchors.fill: parent onPaint: { var ctx = canvas.getContext('2d'); ctx.reset(); ctx.lineWidth = 4; ctx.strokeStyle = "red" ctx.beginPath() ctx.moveTo(root.width / 2, 24) ctx.lineTo(root.width * 0.9, 24) ctx.stroke() ctx.beginPath() ctx.fillStyle = "red" ctx.arc(root.width * 0.9, 24, 6, 0, 360) ctx.fill() } }
-
You'll have to do a "reverse port". See here for the differences between QtQuick 1 and 2
-
The documentation has changed a bit. The links have been updated.