diff options
author | Oliver Eftevaag <oliver.eftevaag@qt.io> | 2022-08-31 17:21:27 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-09-02 05:46:07 +0000 |
commit | 5827a95dd464c3eee12ec0eda9ab8962eb51f0d3 (patch) | |
tree | 5341f888dd0c9efdfd071970a9ff4e706c1dc552 | |
parent | 33eb0fc79d410263849ec0ba3c7971523210afc3 (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.qml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quickcontrols2/imagine/ComboBox.qml b/src/quickcontrols2/imagine/ComboBox.qml index bd44519daf..784ac79ea6 100644 --- a/src/quickcontrols2/imagine/ComboBox.qml +++ b/src/quickcontrols2/imagine/ComboBox.qml @@ -47,10 +47,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) |