aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmltest/layout/tst_layout.qml
blob: 5d9799c6efbfc6a93bba5bdcf9b9aa72215e956c (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
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick 2.2
import QtTest 1.0

TestCase {
    id: testCase
    name: "Tests_Layout"
    when:windowShown
    width:400
    height:400

    function test_invalidParent() {
        ignoreWarning('<Unknown File>:1:49: QML QtObject: Layout must be attached to Item elements')
        var object = Qt.createQmlObject('import QtQuick 2.2; import QtQuick.Layouts 1.0; QtObject { Layout.fillWidth: true }', testCase, '');
        object.destroy()
    }

    function test_defaultPropertyAliasCrash() {
        var containerUserComponent = Qt.createComponent("ContainerUser.qml");
        compare(containerUserComponent.status, Component.Ready);

        var containerUser = containerUserComponent.createObject(testCase);
        verify(containerUser);

        // Shouldn't crash.
        containerUser.destroy();
    }
}