From dc1ae86bad0b4eaa83909f663777c09fb2f2376b Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 3 Nov 2024 13:43:23 +0100 Subject: [PATCH] QCommonStyle: adjust painting CE_ComboBoxLabel text Sync the rect used for painting a CE_ComboBoxLabel text with QLineEdit which is used for an editable QComboBox. Pick-to: 6.8 Task-number: QTBUG-130824 Change-Id: I9f3a31d68c6abed7e9cba4235847df3fa0d51ad1 Reviewed-by: Axel Spoerl --- src/widgets/styles/qcommonstyle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 24968128da3..7b8a97ee770 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -2243,7 +2243,8 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, editRect.translate(cb->iconSize.width() + 4, 0); } if (!cb->currentText.isEmpty() && !cb->editable) { - proxy()->drawItemText(p, editRect.adjusted(1, 0, -1, 0), + // keep in sync with QLineEditPrivate::horizontalMargin = 2 + proxy()->drawItemText(p, editRect.adjusted(2, 0, -2, 0), visualAlignment(cb->direction, cb->textAlignment), cb->palette, cb->state & State_Enabled, cb->currentText); }