Results 1 to 4 of 4

Thread: How to draw a arc

  1. #1
    Join Date
    Jul 2009
    Location
    São Paulo - Brasil
    Posts
    20
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default How to draw a arc

    Hello, boys.

    I would like to draw a arc, you know, just a half circle, I am using setSpanAngle(360*8) and
    setStartAngle(16*90) that is ok, its a arc, but it has a line from the beginning to the end, I need only a arc not a pie. I am using a blank line to hide it, but sometimes the line is draw before and the half circle be full again.

    Someone has a soluction?

    Thanks

    Jorge.

  2. #2
    Join Date
    Aug 2009
    Location
    Lancashire UK
    Posts
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to draw a arc

    I don't get a pie with this, just the arc

    mypainter.drawArc(topleftx,toplefty,diameter,diame ter,startangle,sweep);

    where startangle (your degrees * 16) and sweep (180 * 16) are in those ridiculous 16th of a degree units.

  3. The following user says thank you to andyp for this useful post:

    ProTonS (9th September 2009)

  4. #3
    Join Date
    Jul 2009
    Location
    São Paulo - Brasil
    Posts
    20
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to draw a arc

    Thanks for your time, andyp.

    I am using graphics view and a scene to draw my itens, to use a qpainter I think I have to reimplement my drawning.

    Well, I will search in the forum about that.

    Bye bye.

  5. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to draw a arc

    Depending on your drawing you might also want have a look at QGraphicsPathItem in conjunction with QPainterPath.

  6. The following user says thank you to Lykurg for this useful post:

    ProTonS (9th September 2009)

Similar Threads

  1. partly draw in textEdit.
    By gikidy in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2009, 18:43
  2. Use delegate to draw different type of items
    By nifei in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2009, 13:16
  3. Want to draw Curve
    By santhoshv84 in forum Qt Programming
    Replies: 1
    Last Post: 12th September 2008, 07:14
  4. want to draw points in QGraphicsScene
    By ntp in forum Qt Programming
    Replies: 2
    Last Post: 10th April 2008, 18:14
  5. Using QGLWidget paint engine to draw regular widgtes?
    By high_flyer in forum Qt Programming
    Replies: 11
    Last Post: 9th October 2006, 12:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.