fix_deprecated_drawRoundRect
warning: ‘void QPainter::drawRoundRect(const QRectF&, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations]
void QPainter::drawRoundRect(const QRectF &r, int xRnd = 25, int yRnd = 25)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
void QPainter::drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize)
Draws the given rectangle rect with rounded corners.
The xRadius and yRadius arguments specify the radii of the ellipses defining the corners of the rounded rectangle. When mode is Qt::RelativeSize, xRadius and yRadius are specified in percentage of half the rectangle's width and height respectively, and should be in the range 0.0 to 100.0.
A filled rectangle has a size of rect.size(). A stroked rectangle has a size of rect.size() plus the pen width.
QRectF rectangle(10.0, 20.0, 80.0, 60.0);
QPainter painter(this);
painter.drawRoundedRect(rectangle, 20.0, 15.0);
This function was introduced in Qt 4.4.