QStyleSheetStyle: don't call pixelMetric when not needed
fixupBorder does nothing when bd is null, i.e. hasBorder() returns false. Change-Id: Ic88e3a793f32bd4ad25830ddad9dbd8100348279 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
2c5eb3e668
commit
35b871b2b6
@ -996,6 +996,7 @@ QRenderRule::QRenderRule(const QVector<Declaration> &declarations, const QObject
|
||||
}
|
||||
}
|
||||
|
||||
if (hasBorder()) {
|
||||
if (const QWidget *widget = qobject_cast<const QWidget *>(object)) {
|
||||
QStyleSheetStyle *style = const_cast<QStyleSheetStyle *>(globalStyleSheetStyle);
|
||||
if (!style)
|
||||
@ -1003,9 +1004,10 @@ QRenderRule::QRenderRule(const QVector<Declaration> &declarations, const QObject
|
||||
if (style)
|
||||
fixupBorder(style->nativeFrameWidth(widget));
|
||||
}
|
||||
if (hasBorder() && border()->hasBorderImage())
|
||||
if (border()->hasBorderImage())
|
||||
defaultBackground = QBrush();
|
||||
}
|
||||
}
|
||||
|
||||
QRect QRenderRule::borderRect(const QRect& r) const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user