Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I agree with Neox, the picture is not really a pie ;). If you want an actual pie (that is: a segment of a circle) you can use the inbuilt method of painter:</p> <pre><code>QRect rect( -radius, -radius, radius*2, radius*2); painter-&gt;drawPie( rect, startAngle*16, span*16 ); </code></pre> <p><code>int radius</code><br> the radius of your pie, obviously. </p> <p><code>int startAngle</code><br> where your pie starts, e.g. 20° offset from the positive X axis </p> <p><code>int span</code><br> number of degrees that the arc stretches, e.g. a pie with span = 320° would end at a total of 340°, or -20° from the positive X axis. (see QPainter Documentation for the miraculous *16)</p> <p>This should give you a nice PacMan ^^ - or you can play around with the values.</p> <p>Now, without any more details you need to figure out where to actually place this snippet. Naturally, it would be in the paint method of a some graphical item, e.g. a custom QGraphicsItem, and hence use the painter that comes as input to this method. This really depends on your setup of widgets and stuff...</p> <p>Qt has actually a pretty awesome documentation, so make sure to check this out first: (I've only been at it for two weeks myself, but you can get pretty far with the documentation)</p> <p>QGraphicsItem: <a href="http://qt-project.org/doc/qt-4.8/qgraphicsitem.html" rel="nofollow">http://qt-project.org/doc/qt-4.8/qgraphicsitem.html</a><br> QPainter: <a href="http://qt-project.org/doc/qt-4.8/qpainter.html" rel="nofollow">http://qt-project.org/doc/qt-4.8/qpainter.html</a></p> <p>Cheers, Louise</p> <p>PS: First answer, yay!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload