I am trying to draw a rectangle with big stroke width(set by a QPen) and QPainter is drawing the rectangle but all of the corners are a little cut out, not as sharp as they ought to be. Here is an image: https://i.imgur.com/WhUWLwc.png
I'm drawing it on top of a QWidget using this code:
m_painter.drawRect(upLeftX, upLeftY, downRightX - upLeftX, downRightY - upLeftY);
QPen::setJoinStyle
. You needQt::MiterJoin
. – G.M.