aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/src/concepts/convenience/topic.qdoc
blob: 0f81fa2526a5b783c6acabd05d8f98f50445c930 (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
77
78
79
80
81
82
83
84
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** 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 http://www.qt.io/terms-conditions. For further
** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
\page qtquick-convenience-topic.html
\title Important Concepts In Qt Quick - Convenience Types
\brief Overview of the convenience types for QML core features

In a highly dynamic user interface, the application developer will often wish
to react to events and trigger various response logic.  QML has built-in
support for these concepts through bindings, signals and signal handlers, and
dynamic object instantiation, but Qt Quick expands upon the support
provided by the language with various convenience types.

\section1 Dynamic Object Instantiation

QML provides a number of ways to dynamically create and manage QML objects.

Objects can be created dynamically from within imperative JavaScript code
in various ways.  See \l{qtqml-javascript-dynamicobjectcreation.html}
{Dynamic QML object creation from JavaScript} for more details.

Qt Quick provides the \l{Loader}, \l{Repeater}, \l{ListView}, \l{GridView} and
\l{PathView} types which also support dynamic object management, and provide
a declarative API.

Please see the \l{qtquick-performance.html}{performance guide} for more
information on using dynamic instantiation and lazy initialization to improve
application performance.

\section1 Dynamic Bindings

\l{Property Binding}{Property bindings} are a fundamental feature of QML.
Typically, a property is initialized with its binding. However, the \l Binding
type and \l {Qt::binding()}{Qt.binding()} function allows the client to
dynamically bind properties from any object at run-time, and modify the binding
target when required (or when it becomes available).

\section1 Dynamic Signal Connections

QML supports dynamic signal connections through a signal's \c{connect()}
method. The \l {Qt Quick} module provides the convenience \l Connections type which
allows setting up a signal connection involving an object which isn't part of
the static object hierarchy.  It also allows the connection to be dynamically
retargeted at runtime, which allows an application to process different signal
notifications with different functions depending on the program state.

By declaring a \l Connections instance, the client can dynamically cause
signals emitted by one object to trigger methods of another object, and can
modify the connection target when required (or when it becomes available).

\section1 Timer-Based Events

Another common use-case is to trigger functionality some specified period of
time after a particular event occurs.  These sort of timer-based triggers are
supported in Qt Quick through the \l Timer type.  Both single-shot and
recurring timers are supported.

*/