Skip to content

Add nullptr guard in QStyleSheetStyle::drawPrimitive(PE_PanelLineEdit)

Drawing PE_PanelLineEdit in QStyleSheetStyle with the default argument widget = nullptr causes a segfault.

drawPrimitive tries to fall back to a container widget's render rule and therefore calls containerWidget() - which crashes when called with nullptr.

Container widget fallback is pointless when drawPrimitive() is called with widget == nullptr. This patch skips it in that case.

Fixes: QTBUG-104917 Pick-to: 6.4 6.3 6.2 Change-Id: I09e57dccfebb81a308944c233846d5b9ef58819e Reviewed-by: Volker Hilsheimer volker.hilsheimer@qt.io (cherry picked from commit effc8be3)

Merge request reports

Loading