QPainterPath path; QRectF rect(50, 50, 100, 100); qreal xRadius = 10; qreal yRadius = 10; path.addRoundedRect(rect, xRadius, yRadius);
QPainterPath path; QRectF rect(50, 50, 300, 150); qreal xRadius = 50; qreal yRadius = 50; Qt::CornerFlags corners = Qt::TopLeftCorner | Qt::TopRightCorner; path.addRoundedRect(rect, xRadius, yRadius, Qt::AbsoluteSize, corners);The QPainterPath addRoundedRect function is found in the Qt library.