Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qmlvisual / qdeclarativemousearea / mousearea-flickable.qml
1 import QtQuick 1.0
2
3 Rectangle {
4     width: 400; height: 480
5     color: "white"
6
7     Flickable {
8         anchors.fill: parent
9         contentHeight: 100
10
11         Rectangle {
12             id: yellow
13             width: 400; height: 120
14             color: "yellow"
15             MouseArea {
16                 anchors.fill: parent
17                 onPressedChanged: pressed ? yellow.color = "lightyellow": yellow.color = "yellow"
18             }
19         }
20         Rectangle {
21             id: blue
22             width: 400; height: 120
23             y: 120
24             color: "steelblue"
25             MouseArea {
26                 anchors.fill: parent
27                 onPressed: blue.color = "lightsteelblue"
28                 onCanceled: blue.color = "steelblue"
29             }
30         }
31         Rectangle {
32             id: red
33             y: 240
34             width: 400; height: 120
35             color: "red"
36             MouseArea {
37                 anchors.fill: parent
38                 onEntered:  { red.color = "darkred"; tooltip.opacity = 1 }
39                 onCanceled: { red.color = "red"; tooltip.opacity = 0 }
40             }
41             Rectangle {
42                 id: tooltip
43                 x: 10; y: 20
44                 width: 100; height: 50
45                 color: "green"
46                 opacity: 0
47             }
48         }
49
50     }
51
52 }