aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/touchinteraction/multipointtouch/multiflame.qml
blob: cdb882c6072246d67495eb8b9ac94abe767068e3 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick 2.0

Rectangle {
    width: 360
    height: 480
    color: "black"

//! [0]
    MultiPointTouchArea {
        anchors.fill: parent
        minimumTouchPoints: 1
        maximumTouchPoints: 5
        touchPoints: [
            TouchPoint { id: touch1 },
            TouchPoint { id: touch2 },
            TouchPoint { id: touch11 },
            TouchPoint { id: touch21 },
            TouchPoint { id: touch31 }
        ]
    }
//! [0]

//! [1]
    ParticleFlame {
        color: "red"
        emitterX: touch1.x
        emitterY: touch1.y
        emitting: touch1.pressed
    }
//! [1]
    ParticleFlame {
        color: "green"
        emitterX: touch2.x
        emitterY: touch2.y
        emitting: touch2.pressed
    }
    ParticleFlame {
        color: "yellow"
        emitterX: touch11.x
        emitterY: touch11.y
        emitting: touch11.pressed
    }
    ParticleFlame {
        color: "blue"
        emitterX: touch21.x
        emitterY: touch21.y
        emitting: touch21.pressed
    }
    ParticleFlame {
        color: "violet"
        emitterX: touch31.x
        emitterY: touch31.y
        emitting: touch31.pressed
    }
}