From e2bfcd58efa55ceff751dfb97f17817d65382a04 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 1 Jun 2025 20:50:07 +0200 Subject: [PATCH] StyleSheetStyle: Don't paint CE_ComboBoxLabel when no stylesheet is set Don't paint through stylesheet code when a combobox label has no stylesheet set at all. This should be done also for others but may break existing painting stuff so only fix this here as it's a regression from a77a7c157d5cdcc88bf0a02caed2aa5ff8850d06. Pick-to: 6.8 Task-number: QTBUG-131761 Fixes: QTBUG-137108 Change-Id: I462ba198821692aa60e6869df9c8e92332422c44 Reviewed-by: Axel Spoerl (cherry picked from commit db07a0387497cc56d4c3a82bbbc2150ec19d2e96) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit eae538fa065ea3b3175f593bd37a9f420ee8727f) --- src/widgets/styles/qstylesheetstyle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index d735a13abaf..9859dc370cf 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -4067,6 +4067,8 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q #if QT_CONFIG(combobox) case CE_ComboBoxLabel: + if (!rule.hasDrawable()) + break; if (const QStyleOptionComboBox *cb = qstyleoption_cast(opt)) { QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, w); p->save();