PDA

View Full Version : How to drawing a simple shape



powerboy2988
19th November 2015, 08:18
Hi every one ... ;)
I have a simple question,, How can i draw this shape with qpainterPath (lineTo and arcTo)?

11524


Thanks a lot ;)

d_stranz
19th November 2015, 18:00
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.