Skip to content

Instantly share code, notes, and snippets.

@HamedMasafi
Created December 31, 2017 07:38
Show Gist options
  • Save HamedMasafi/54854a6b2e15130825d511b73a1a774d to your computer and use it in GitHub Desktop.
Save HamedMasafi/54854a6b2e15130825d511b73a1a774d to your computer and use it in GitHub Desktop.
Shape in canvas sample
import QtQuick 2.0
Item {
Canvas {
id: mycanvas
contextType: "2d"
anchors.fill: parent
Path{
id: path
startX: 0
startY: 0
PathQuad{
x:100
y:100
controlX: 50
controlY: 70
}
}
onPaint: {
context.reset();
context.strokeStyle = Qt.rgba(.4,.6,.8);
context.path = path;
context.stroke();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment