ad70b9a9908c9e05206d5c743be79ec42cce07f9
[profile/ivi/qtdeclarative.git] / src / quick / doc / src / concepts / convenience / topic.qdoc
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the documentation of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:FDL$
9 ** GNU Free Documentation License
10 ** Alternatively, this file may be used under the terms of the GNU Free
11 ** Documentation License version 1.3 as published by the Free Software
12 ** Foundation and appearing in the file included in the packaging of
13 ** this file.
14 **
15 ** Other Usage
16 ** Alternatively, this file may be used in accordance with the terms
17 ** and conditions contained in a signed written agreement between you
18 ** and Nokia.
19 **
20 **
21 **
22 **
23 **
24 ** $QT_END_LICENSE$
25 **
26 ****************************************************************************/
27
28 /*!
29 \page qtquick-convenience-topic.html
30 \title Important Concepts In Qt Quick - Convenience Types
31 \brief Overview of the convenience types for QML core features
32
33 In a highly dynamic user interface, the application developer will often wish
34 to react to events and trigger various response logic.  QML has built-in
35 support for these concepts through bindings, signals and signal handlers, and
36 dynamic object instantiation, but Qt Quick expands upon the support
37 provided by the language with various convenience types.
38
39 \section1 Dynamic Object Instantiation
40
41 QML provides a number of ways to dynamically create and manage QML objects.
42
43 Objects can be created dynamically from within imperative JavaScript code
44 in various ways.  See \l{qtqml-javascript-dynamicobjectcreation.html}
45 {Dynamic QML object creation from JavaScript} for more details.
46
47 Qt Quick provides the \l{Loader}, \l{Repeater}, \l{ListView}, \l{GridView} and
48 \l{PathView} types which also support dynamic object management, and provide
49 a declarative API.
50
51 Please see the \l{qtquick-performance.html}{performance guide} for more
52 information on using dynamic instantiation and lazy initialization to improve
53 application performance.
54
55 \section1 Dynamic Bindings
56
57 Assigning binding expressions to properties is a fundamental concept of QML,
58 and Qt Quick extends upon the idea with the \l Binding type.   While bindings
59 are typically specified as property initialization assignments, the \l Binding
60 type allows the target of a binding to be defined explicitly and separately
61 from the definition of the binding expression itself.
62 By declaring a \l Binding instance, the client can dynamically bind properties
63 from arbitrary objects at run-time, and can modify the binding target when
64 required (or when it becomes available).
65
66 \section1 Dynamic Signal Connections
67
68 QML supports dynamic signal connections through a signal's \c{connect()}
69 method. The QtQuick module provides the convenience \l Connections type which
70 allows setting up a signal connection involving an object which isn't part of
71 the static object hierarchy.  It also allows the connection to be dynamically
72 retargeted at runtime, which allows an application to process different signal
73 notifications with different functions depending on the program state.
74
75 By declaring a \l Connections instance, the client can dynamically cause
76 signals emitted by one object to trigger methods of another object, and can
77 modify the connection target when required (or when it becomes available).
78
79 \section1 Timer-Based Events
80
81 Another common use-case is to trigger functionality some specified period of
82 time after a particular event occurs.  These sort of timer-based triggers are
83 supported in Qt Quick through the \l Timer type.  Both single-shot and
84 recurring timers are supported.
85
86 */
87