aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Eftevaag <oliver.eftevaag@qt.io>2022-08-31 17:21:27 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-02 05:46:07 +0000
commit761eea369ded70bbf0f9dc3e45e2e0f972e4b436 (patch)
tree73774cf40eaed5e5a9f6b7bb428d37a3ed7aeb9a
parent9e2705e0271bc3f39ca6c9f572e6061d5ac2c2ae (diff)
Imagine: fix ComboBox's implicit size bindings
The parentheses were misplaced, causing e.g. contentItem.implicitWidth to be ignored. Without any parentheses, the same issue is present due to evaluation order, so we do still need them, just in the correct place. While we're at it, we replace contentItem.implicitWidth with implicitContentWidth so that Imagine respects implicitContentWidthPolicy (which was added in 49ffc6e6af83b295c67fd119b79c925879cc292e). Fixes: QTBUG-106098 Change-Id: I6ff08f5cb9309ae0494d95917ce8b7a22d2ba663 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit e11df48384e38f2903a88f8dd3db49b78f1e27c6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quickcontrols2/imagine/ComboBox.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quickcontrols2/imagine/ComboBox.qml b/src/quickcontrols2/imagine/ComboBox.qml
index 960d58334a..254313454c 100644
--- a/src/quickcontrols2/imagine/ComboBox.qml
+++ b/src/quickcontrols2/imagine/ComboBox.qml
@@ -11,10 +11,10 @@ T.ComboBox {
id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
- contentItem.implicitWidth + background ? (background.leftPadding + background.rightPadding) : 0)
+ implicitContentWidth + (background ? background.leftPadding + background.rightPadding : 0))
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
Math.max(implicitContentHeight,
- implicitIndicatorHeight) + background ? (background.topPadding + background.bottomPadding) : 0)
+ implicitIndicatorHeight) + (background ? background.topPadding + background.bottomPadding : 0))
leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)