Results 1 to 2 of 2

Thread: How to drawing a simple shape

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2015
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Question How to drawing a simple shape

    Hi every one ...
    I have a simple question,, How can i draw this shape with qpainterPath (lineTo and arcTo)?

    ellipse.png


    Thanks a lot

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,315
    Thanks
    314
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to drawing a simple shape

    Starting with the vertical line on the right, create a QPainterPath, move to the lower end of the line, add a line to the upper end of the line, add an arc inside the rectangle of the top arc starting at 0 degrees and ending at 180 degrees, then add a line to the bottom of the left vertical line, and add another arc from 180 degrees to 360 degrees in the bottom arc rectangle. If you want to be able to fill the inside of the shape, close the path.

    I'll let you figure out the actual sequence of moveTo(), lineTo() and arcTo() calls.

Similar Threads

  1. Replies: 5
    Last Post: 24th June 2011, 12:07
  2. Fast(est) way of drawing simple objects
    By eperfa in forum Newbie
    Replies: 6
    Last Post: 9th April 2011, 20:24
  3. Whats the right approach for drawing a simple graph?
    By Menia in forum Qt Programming
    Replies: 1
    Last Post: 2nd September 2010, 15:34
  4. Replies: 4
    Last Post: 15th March 2010, 12:52
  5. Replies: 3
    Last Post: 3rd March 2009, 12:24

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
  •  
Qt is a trademark of The Qt Company.