Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qmlvisual / qdeclarativemousearea / nested.qml
1 import QtQuick 1.0
2
3 /*
4   Test nested MouseArea with different drag axes.
5 */
6
7 Rectangle{
8     width:400
9     height:360
10     color: "white"
11     Flickable {
12         anchors.fill: parent
13         contentWidth: 600
14         contentHeight: 600
15         Rectangle{
16             id: draggable
17             width:200; height:200; color: "lightsteelblue"
18             opacity: ma1.drag.active ? 0.5 : 1.0
19             y:20
20             MouseArea{
21                 id: ma1
22                 objectName: "one"
23                 anchors.fill: parent
24                 drag.target: draggable
25                 drag.axis: "XandYAxis"
26                 drag.filterChildren: true
27                 drag.minimumX: 0
28                 drag.maximumX: 200
29                 drag.minimumY: 20
30                 drag.maximumY: 220
31                 Rectangle{
32                     id: draggable_inner
33                     width:40; height:40; color: "red"
34                         y:20
35                     MouseArea{
36                         objectName: "two"
37                         anchors.fill: parent
38                         drag.target: draggable_inner
39                         drag.axis: "XAxis"
40                         drag.minimumX: 0
41                         drag.maximumX: 360
42                     }
43                 }
44             }
45         }
46         Rectangle{
47             id: draggable3
48             width:40; height:40; color: "green"
49             opacity: ma3.drag.active ? 0.5 : 1.0
50             y:210
51             MouseArea{
52                 id: ma3
53                 objectName: "three"
54                 anchors.fill: parent
55                 drag.target: draggable3
56                 drag.axis: "XAxis"
57                 drag.minimumX: 0
58                 drag.maximumX: 360
59             }
60         }
61     }
62 }