From 0571bf6d8a601048fa26ea8807dc7378403bdb2d Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 24 Jan 2024 13:12:11 +0100 Subject: [PATCH] Inline one qDrawPlainRoundedRect overload Don't export both, the one is just calling the other, so make it inline. Give parameters descriptive names that match the documentation. Found in header review. Change-Id: I48b221a4fcc476483fee2842ec0a5cadd628b803 Reviewed-by: Marc Mutz (cherry picked from commit 703f922b18110ed90018bd05526661937c3067f6) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/styles/qdrawutil.cpp | 7 ------- src/widgets/styles/qdrawutil.h | 9 +++++++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/widgets/styles/qdrawutil.cpp b/src/widgets/styles/qdrawutil.cpp index fd76291401e..41b4886f2f9 100644 --- a/src/widgets/styles/qdrawutil.cpp +++ b/src/widgets/styles/qdrawutil.cpp @@ -909,13 +909,6 @@ void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &c, \sa qDrawShadeRect(), QStyle */ -void qDrawPlainRoundedRect(QPainter *p, const QRect &r, qreal rx, qreal ry, - const QColor &c, int lineWidth, const QBrush *fill) -{ - qDrawPlainRoundedRect(p, r.x(), r.y(), r.width(), r.height(), rx, ry, c, - lineWidth, fill); -} - /*! \class QTileRules \since 4.6 diff --git a/src/widgets/styles/qdrawutil.h b/src/widgets/styles/qdrawutil.h index a4732e014ef..26d8d5075f3 100644 --- a/src/widgets/styles/qdrawutil.h +++ b/src/widgets/styles/qdrawutil.h @@ -75,8 +75,13 @@ Q_WIDGETS_EXPORT void qDrawPlainRoundedRect(QPainter *p, int x, int y, int w, in qreal rx, qreal ry, const QColor &, int lineWidth = 1, const QBrush *fill = nullptr); -Q_WIDGETS_EXPORT void qDrawPlainRoundedRect(QPainter *p, const QRect& r, qreal rx, qreal ry, - const QColor &, int lineWidth = 1, const QBrush *fill = nullptr); +inline void qDrawPlainRoundedRect(QPainter *painter, const QRect& rect, qreal rx, qreal ry, + const QColor &lineColor, int lineWidth = 1, + const QBrush *fill = nullptr) +{ + qDrawPlainRoundedRect(painter, rect.x(), rect.y(), rect.width(), rect.height(), + rx, ry, lineColor, lineWidth, fill); +} struct QTileRules