aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmltest/positioners/tst_positioners.qml
blob: 3933616de2dcb145edbceaaa0a53764dedd980aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

import QtQuick 2.9
import QtTest 1.1

Item {
    Column {
        id: column
        Repeater {
            id: repeater
            model: 2
            Rectangle {
                width: 100
                height: 30
                border.width: 1
            }
        }
    }

    SignalSpy {
        id: spy
        target: column
        signalName: "positioningComplete"
    }

    TestCase {
        function test_forceLayout() {
            compare(column.height, 60)
            repeater.model = 4
            column.forceLayout()
            compare(column.height, 120)

            // initial positioning and our forced layout
            compare(spy.count, 2)
        }
    }
}