aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc
blob: 519e79e741a119baf89086b94b88abeb37d63a97 (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
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
    \title Qt Quick Examples - Touch Interaction
    \example touchinteraction
    \brief A collection of QML Touch Interaction examples.
    \image qml-touchinteraction-example.png

    \e{Touch Interaction} is a collection of small QML examples relating to
    touch interaction methods. For more information, visit
    \l{Important Concepts In Qt Quick - User Input}.

    \include examples-run.qdocinc

    \section1 Multipoint Flames Example

    \e{Multipoint Flames} demonstrates distinguishing different fingers in a
    \l MultiPointTouchArea, by assigning a different colored flame to each touch
    point.

    The MultipointTouchArea sets up multiple touch points:
    \snippet touchinteraction/multipointtouch/multiflame.qml 0

    The flames are then simply bound to the coordinates of the touch point, and
    whether it is currently pressed, as follows:
    \snippet touchinteraction/multipointtouch/multiflame.qml 1

    \section1 Bear-Whack Example

    \e{Bear-Whack} demonstrates using \l MultiPointTouchArea to add multiple
    finger support to a simple game. The interaction with the game
    is done through a SpriteGoal that follows the TouchPoint. The TouchPoints
    added to the MultiPointTouchArea are a component with the relevant logic
    embedded into it:
    \snippet touchinteraction/multipointtouch/AugmentedTouchPoint.qml 0

    \section1 Flick Resize Example

    \e{Flick Resize} uses a \l PinchArea to implement a \e{pinch-to-resize}
    behavior. This is easily achieved by listening to the PinchArea signals and
    responding to user input.
    \snippet touchinteraction/pincharea/flickresize.qml 0

    \section1 Flickable Example

    \e Flickable is a simple example demonstrating the \l Flickable type.
    \snippet touchinteraction/flickable/basic-flickable.qml 0

    \section1 Corkboards Example

    \e Corkboards shows another use for \l Flickable, with QML types within the
    flickable object that respond to mouse and keyboard interaction. This
    behavior does not require special code as the Qt Quick types already
    cooperate with the Flickable type for accepting touch events.
*/