aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlconnections/data/functions/connection-targetchange.qml
blob: 692194e83731ea4f13d83b4a0703200fadaaed16 (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
import QtQuick 2.0

Item {
    Component {
        id: item1
        Item {
            objectName: "item1"
        }
    }
    Component {
        id: item2
        Item {
            objectName: "item2"
        }
    }
    Loader {
        id: loader
        sourceComponent: item1
    }
    Connections {
        objectName: "connections"
        target: loader.item
        function onWidthChanged() { loader.sourceComponent = item2 }
    }
}