Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Canvas in QML
Forum Updated to NodeBB v4.3 + New Features

Canvas in QML

Scheduled Pinned Locked Moved QML and Qt Quick
canvasqmlqt5
1 Posts 1 Posters 804 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vishnukumarmdu
    wrote on last edited by vishnukumarmdu
    #1

    I have a written a simple program which i given below. I am able to see two minor spokes between the angles i am drawing. I am not sure why its coming. Any help is appreciated.
    import QtQuick 2.0

    Rectangle {
    width: 360
    height: 360
    Canvas
    {
    width: 360
    height: 360
    onPaint:
    {
    var x = 140
    var y = 140
    var radius = 140;
    var startangle = -90
    var endangle = 30
    var context = getContext("2d");
    for(var j=0; j < 3; j++)
    {
    context.beginPath();
    context.moveTo(x, y);
    context.arc(x, y, radius, (startangle)(Math.PI/180), (endangle)(Math.PI/180), false) //x, y, radius, startAngle, endAngle, anticlockwise
    context.fillStyle = "blue"
    context.fill();
    startangle += 120
    endangle += 120
    context.closePath();
    }
    }
    }
    }
    Does anybody have idea on this

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved