QFusionStyle: remove dead code from drawItemText()

The !enabled branch does nothing so it can be safely removed. Also
remove the unneeded documentation since it's a simple reimplementation
from the base class.

Change-Id: Iea6e77ab42b09a30f73ae2f1f671eb4198a31c41
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Christian Ehrlicher 2023-10-20 15:05:58 +02:00
parent f1c2a24255
commit e0395cdbf7

View File

@ -375,37 +375,18 @@ QFusionStyle::~QFusionStyle()
}
/*!
\fn void QFusionStyle::drawItemText(QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette,
bool enabled, const QString& text, QPalette::ColorRole textRole) const
Draws the given \a text in the specified \a rectangle using the
provided \a painter and \a palette.
Text is drawn using the painter's pen. If an explicit \a textRole
is specified, then the text is drawn using the \a palette's color
for the specified role. The \a enabled value indicates whether or
not the item is enabled; when reimplementing, this value should
influence how the item is drawn.
The text is aligned and wrapped according to the specified \a
alignment.
\sa Qt::Alignment
\reimp
*/
void QFusionStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
bool enabled, const QString& text, QPalette::ColorRole textRole) const
{
Q_UNUSED(enabled);
if (text.isEmpty())
return;
QPen savedPen = painter->pen();
if (textRole != QPalette::NoRole) {
if (textRole != QPalette::NoRole)
painter->setPen(QPen(pal.brush(textRole), savedPen.widthF()));
}
if (!enabled) {
QPen pen = painter->pen();
painter->setPen(pen);
}
painter->drawText(rect, alignment, text);
painter->setPen(savedPen);
}