Unevenly drawn circle from QPainter->drawEllipse()
-
I'm drawing the following circle in a QGraphicsObject::paint():
!http://dl.dropbox.com/u/623207/Qt_Uneven_ellipse.png(Uneven drawEllipse)!
using:
painter->drawEllipse(QRectF(...));
with a Qt::SolidPattern brush and a QPen() with an adjusted width.is there any way I can remove the extra non-circle part of the border seen to the right in the picture?
Thanks, Greger
-
I think you can draw your primitive inside a QPainterPath, and then make the difference between booth.
Look at : "QPainterPath doc":http://qt-project.org/doc/qt-4.8/qpainterpath.html -
Thanks dridk, that did the trick! Not that I understand why it makes a difference.
So using
@
QPainterPath circle_path;
circle_path.addEllipse(circle);
painter->drawPath(circle_path);
@makes a nicer circle than
@
painter->drawEllipse(circle);
@At least with Qt 4.7.4 on a Mac.
-
All you need is the border of the circle? If so, you should.
@
painter.setBrush(Qt::NoBrush);
@