summaryrefslogtreecommitdiff
path: root/doc/qtcreator/src/qtquick/qtquick-connection-editor.qdoc
blob: a79d9c88fd1a8c814bb0ceccc76687648c5986a3 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/

/*!
    \contentspage index.html
    \previouspage quick-states.html
    \page qmldesigner-connections.html
    \nextpage quick-signals.html

    \title Adding Connections

    The user interface components and the application need to communicate with
    each other. For example, a button needs to know that the user has clicked
    on it. The button may then change color to indicate its state or perform an
    action. Further, the application needs to know whether the user is clicking
    the button, because it may need to relay this clicking event to other
    applications.

    QML has a signal and handler mechanism, that enables components to respond
    to application events. Events are represented by \e signals. When a signal
    is emitted, the corresponding \e {signal handler} is invoked to respond to
    the event by using scripts or other operations placed in the handler.

    To access a signal outside of the object that emits it, you can use the
    \l Connections type for connecting to signals of arbitrary objects. A
    Connections object can receive any signal from its specified target.

    A component's property can be assigned a static value which stays constant
    until it is explicitly assigned a new value. However, to make the fullest
    use of QML and its built-in support for dynamic object behaviors, most QML
    types use property bindings. This means that you can specify relationships
    between different object properties so that when a property's sependencies
    change in value, the property's value is automatically updated accordingly.

    Behind the scenes, the QML engine monitors the property's dependencies (that
    is, the variables in the binding expression). When a change is detected, the
    QML engine re-evaluates the binding expression and applies the new result to
    the property.

    The following sections describe how to use the \uicontrol {Connections} view
    to perform the following tasks:

    \list
        \li \l{Connecting Objects to Signals}
        \li \l{Specifying Dynamic Properties}
        \li \l{Adding Bindings Between Properties}
        \if defined(qtcreator)
        \li \l{Managing C++ Backend Objects}
        \endif
    \endlist

    For an example of using properties, bindings, and connections to create a
    scalable push button, see \l{Creating Scalable Buttons and Borders}.
*/