summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/pathview/pathattributes.qml
blob: 19a192ceb9d3c1f707dbc5e6257e65e78cff8c6a (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
import Qt 4.6

Rectangle {
    width: 240; height: 200; color: 'white'
//! [0]
//! [1]
    Component {
        id: delegate
        Item {
            id: wrapper
            width: 80; height: 80
            scale: PathView.scale
            opacity: PathView.opacity
            Column {
                Image { anchors.horizontalCenter: name.horizontalCenter; width: 64; height: 64; source: icon }
                Text { id: name; text: name; font.pointSize: 16}
            }
        }
    }
//! [1]
//! [2]
    PathView {
        anchors.fill: parent; model: MenuModel; delegate: delegate
        path: Path {
            startX: 120; startY: 100
            PathAttribute { name: "scale"; value: 1.0 }
            PathAttribute { name: "opacity"; value: 1.0 }
            PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
            PathAttribute { name: "scale"; value: 0.3 }
            PathAttribute { name: "opacity"; value: 0.5 }
            PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
        }
    }
//! [2]
//! [0]
}