Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Canvas in QML

    QML and Qt Quick
    canvas qml qt5
    1
    1
    642
    Loading More Posts
    • 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
      vishnukumarmdu last edited by vishnukumarmdu

      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 Reply Quote 0
      • First post
        Last post