aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmltypeloader/data/test_intercept.qml
blob: 930d481f7be88604cdb7bff3142ec65bc00c3fb8 (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
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

import QtQuick 2.0

ListView {
    width: 400
    height: 500
    model: 2

    id: test
    property int created: 0
    property int loaded: 0

    delegate: Loader {
        width: ListView.view.width
        height: 100
        asynchronous: true
        source: index == 0 ? "Intercept.qml" : "GenericView.qml"

        onLoaded: {
            test.loaded++
        }
        Component.onCompleted: {
            test.created++
        }
    }
}