summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2014-01-15 13:22:12 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-28 12:13:52 +0100
commit17788ca8f0d6fe4fb0d03e99e34ed667fde54379 (patch)
treea10790a239ff94cca7d2df096bbdb9c18f2a8d29 /tests
parent5dc805c86077ee9cd10af530f802fdda879cfb6a (diff)
downloadqtquickcontrols-17788ca8f0d6fe4fb0d03e99e34ed667fde54379.tar.gz
Allow size hint changes during a rearrange.
Previously, we marked the layout as not dirty straight after a rearrange was done. However, in the case of when a size hint changed during a rearrange that would block the pending rearrange (since it only perform the actual rearrange if its dirty). Instead, mark the layout as not dirty *before* the rearrange. This will allow bindings such as implicitWidth: height to execute the pending rearrange. (Although such bindings are not encouraged) Task-number: QTBUG-36169 Change-Id: I75bd821a0ca4302026bd5dac01287ca3359d471b Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_rowlayout.qml36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_rowlayout.qml b/tests/auto/controls/data/tst_rowlayout.qml
index c82a16d4..9db6c803 100644
--- a/tests/auto/controls/data/tst_rowlayout.qml
+++ b/tests/auto/controls/data/tst_rowlayout.qml
@@ -536,6 +536,42 @@ Item {
layout.destroy()
}
+
+ Component {
+ id: layout_change_implicitWidth_during_rearrange
+ ColumnLayout {
+ width: 100
+ height: 20
+ RowLayout {
+ spacing: 0
+ Rectangle {
+ Layout.fillHeight: true
+ Layout.fillWidth: false
+ implicitWidth: height
+ color: "red"
+ }
+ Rectangle {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ color: "blue"
+ }
+ }
+ }
+ }
+
+ function test_change_implicitWidth_during_rearrange() {
+ var layout = layout_change_implicitWidth_during_rearrange.createObject(container)
+ var red = layout.children[0].children[0]
+ var blue = layout.children[0].children[1]
+ waitForRendering(layout);
+ tryCompare(red, 'width', 20)
+ tryCompare(blue, 'width', 80)
+ layout.height = 40
+ tryCompare(red, 'width', 40)
+ tryCompare(blue, 'width', 60)
+ layout.destroy()
+ }
+
Component {
id: layout_addIgnoredItem_Component
RowLayout {