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