Qt drawing a filled rounded rectangle with border
You can create a QPainterPath, add the rounded rect to it, and then fill and stroke it: QPainter p(this); p.setRenderHint(QPainter::Antialiasing); QPainterPath path; path.addRoundedRect(QRectF(10, 10, 100, 50), 10, 10); QPen pen(Qt::black, 10); p.setPen(pen); p.fillPath(path, Qt::red); p.drawPath(path); Note that even with antialiasing, 1 px border will probably never really look good, especially on a low DPI desktop … Read more