File: hoverPropagation.qml

package info (click to toggle)
qtdeclarative-opensource-src-gles 5.15.17%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 258,992 kB
  • sloc: javascript: 512,415; cpp: 497,385; xml: 8,892; python: 3,304; ansic: 2,764; sh: 206; makefile: 46; php: 27
file content (54 lines) | stat: -rw-r--r-- 1,275 bytes parent folder | download | duplicates (15)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import QtQuick 2.0

Item{
    width: 400
    height: 200
    property bool point1: ma2.containsMouse && !ma1.containsMouse
    property bool point2: ma3.containsMouse && ma4.containsMouse
    Rectangle{
        width: 200
        height: 200
        color: ma1.containsMouse ? "red" : "white"
        MouseArea{
            id: ma1
            hoverEnabled: true
            anchors.fill: parent
        }
        Rectangle{
            width: 100
            height: 100
            color: ma2.containsMouse ? "blue" : "white"
            MouseArea{
                id: ma2
                hoverEnabled: true
                anchors.fill: parent
            }
        }
    }

    Item{
        x:200
        Rectangle{
            width: 200
            height: 200
            color: ma3.containsMouse ? "yellow" : "white"
            Rectangle{
                width: 100
                height: 100
                color: ma4.containsMouse ? "green" : "white"
            }
        }
        MouseArea{
            id: ma3
            hoverEnabled: true
            width: 200
            height: 200
            MouseArea{
                id: ma4
                width: 100
                height: 100
                hoverEnabled: true
            }
        }
    }
}