summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/drag.qml
blob: 9465efb53117a3a2d14ad3653c26ccef953dd215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import Qt 4.7

//! [0]
Rectangle {
    id: blurtest; width: 600; height: 200; color: "white"
    Image {
        id: pic; source: "qtlogo-64.png"; anchors.verticalCenter: parent.verticalCenter
        opacity: (600.0-pic.x) / 600;
        MouseArea {
            anchors.fill: parent
            drag.target: pic
            drag.axis: "XAxis"
            drag.minimumX: 0
            drag.maximumX: blurtest.width-pic.width
        }
    }
}
//! [0]