Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
topic.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2017 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qtquick-convenience-topic.html
6
\title Important Concepts In Qt Quick - Convenience Types
7
\brief Overview of the convenience types for QML core features
8
9
In a highly dynamic user interface, the application developer will often wish
10
to react to events and trigger various response logic. QML has built-in
11
support for these concepts through bindings, signals and signal handlers, and
12
dynamic object instantiation, but Qt Quick expands upon the support
13
provided by the language with various convenience types.
14
15
\section1 Dynamic Object Instantiation
16
17
QML provides a number of ways to dynamically create and manage QML objects.
18
19
Objects can be created dynamically from within imperative JavaScript code
20
in various ways. See \l{qtqml-javascript-dynamicobjectcreation.html}
21
{Dynamic QML object creation from JavaScript} for more details.
22
23
Qt Quick provides the \l{Loader}, \l{Repeater}, \l{ListView}, \l{GridView} and
24
\l{PathView} types which also support dynamic object management, and provide
25
a declarative API.
26
27
Please see the \l{qtquick-performance.html}{performance guide} for more
28
information on using dynamic instantiation and lazy initialization to improve
29
application performance.
30
31
\section1 Dynamic Bindings
32
33
\l{Property Binding}{Property bindings} are a fundamental feature of QML.
34
Typically, a property is initialized with its binding. However, the \l Binding
35
type and \l {Qt::binding()}{Qt.binding()} function allows the client to
36
dynamically bind properties from any object at run-time, and modify the binding
37
target when required (or when it becomes available).
38
39
\section1 Dynamic Signal Connections
40
41
QML supports dynamic signal connections through a signal's \c{connect()}
42
method. The \l {Qt Quick} module provides the convenience \l Connections type which
43
allows setting up a signal connection involving an object which isn't part of
44
the static object hierarchy. It also allows the connection to be dynamically
45
retargeted at runtime, which allows an application to process different signal
46
notifications with different functions depending on the program state.
47
48
By declaring a \l Connections instance, the client can dynamically cause
49
signals emitted by one object to trigger methods of another object, and can
50
modify the connection target when required (or when it becomes available).
51
52
\section1 Timer-Based Events
53
54
Another common use-case is to trigger functionality some specified period of
55
time after a particular event occurs. These sort of timer-based triggers are
56
supported in Qt Quick through the \l Timer type. Both single-shot and
57
recurring timers are supported.
58
59
*/
qtdeclarative
src
quick
doc
src
concepts
convenience
topic.qdoc
Generated on
for Qt by
1.14.0