Remove some dead code from QLabel::paintEvent()

The code removed was in a if (d->control) block and therefore d->control
was always going to be true thus rendering the nested if invalid. The
case that this would account for is already handled in the else for the
parent if so this code is in effect not needed.

Change-Id: I799383e238560a8a8e3d7dc073d3b1ee74269f90
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
This commit is contained in:
Andy Shaw 2012-12-06 08:37:10 +01:00 committed by The Qt Project
parent a380c108a6
commit 6797413db2

View File

@ -1032,20 +1032,6 @@ void QLabel::paintEvent(QPaintEvent *)
d->ensureTextLayouted(); d->ensureTextLayouted();
QAbstractTextDocumentLayout::PaintContext context; QAbstractTextDocumentLayout::PaintContext context;
if (!isEnabled() && !d->control &&
// We cannot support etched for rich text controls because custom
// colors and links will override the light palette
style->styleHint(QStyle::SH_EtchDisabledText, &opt, this)) {
context.palette = opt.palette;
context.palette.setColor(QPalette::Text, context.palette.light().color());
painter.save();
painter.translate(lr.x() + 1, lr.y() + 1);
painter.setClipRect(lr.translated(-lr.x() - 1, -lr.y() - 1));
QAbstractTextDocumentLayout *layout = d->control->document()->documentLayout();
layout->draw(&painter, context);
painter.restore();
}
// Adjust the palette // Adjust the palette
context.palette = opt.palette; context.palette = opt.palette;