diff options
Diffstat (limited to 'src/qml/doc/src/javascript/topic.qdoc')
-rw-r--r-- | src/qml/doc/src/javascript/topic.qdoc | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/src/qml/doc/src/javascript/topic.qdoc b/src/qml/doc/src/javascript/topic.qdoc index f910cc38c9..2302f90fbe 100644 --- a/src/qml/doc/src/javascript/topic.qdoc +++ b/src/qml/doc/src/javascript/topic.qdoc @@ -1,29 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://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 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. -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \page qtqml-javascript-topic.html \title Integrating QML and JavaScript @@ -48,6 +24,25 @@ See the documentation page titled \l{qtqml-javascript-expressions.html}{JavaScript Expressions in QML Documents} for more information about using JavaScript expressions in QML. +\section1 Dynamic QML Object Creation from JavaScript + +QML supports the dynamic creation of objects from within JavaScript. This is +useful to delay instantiation of objects until necessary, thereby improving +application startup time. It also allows visual objects to be dynamically +created and added to the scene in reaction to user input or other events. This +functionality can be used in two main ways. + +Object can be created dynamically from JavaScript in an imperative way using +\l{qtqml-javascript-dynamicobjectcreation.html}{dynamic creation of objects}. +This can be useful, for example, when QML is used as an application scripting +language. + +\note When creating user interfaces, the preferred way of creating objects +dynamically is to use declarative constructs as these integrate best with the +QML engine and tooling. Various types exist to enable this functionality such +as the \l{Loader}, \l{Instantiator}, \l{Repeater} types. + + \section1 JavaScript Resources Application logic defined in JavaScript functions may be separated into @@ -81,6 +76,10 @@ These limitations and extensions are documented in the description of the \l{qtqml-javascript-hostenvironment.html}{JavaScript Host Environment} provided by the QML engine. +There is also an in depth description of the +\l{qtqml-javascript-memory.html}{memory management} employed by the JavaScript +engine. + \section1 Configuring the JavaScript engine For specific use cases you may want to override some of the parameters the |