aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/javascript/qmlglobalobject.qdoc
blob: 15b9996ff3c735d03e45e0b641c37dddd891745e (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
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\page qtqml-javascript-qmlglobalobject.html
\title QML Global Object
\brief Description of the Qml Global Object


The QML JavaScript host environment implements the following host objects and functions.
They are built-in, so you can use them from any JavaScript code loaded in QML, without
additional imports:

\list
\li The \l{QmlGlobalQtObject}{Qt object}: A QML object that offers helper methods
    and properties specific to the QML environment.
\li \l {Qt::}{qsTr()}, \l {Qt::}{qsTranslate()}, \l {Qt::}{qsTrId()}, \l {Qt::}{qsTrNoOp()},
    \l {Qt::}{qsTranslateNoOp()}, \l {Qt::}{qsTrIdNoOp()} functions:
    QML functions that let you translate \l{Mark Strings for Translation}
    {strings} and \l{Mark Translatable Data Text Strings}{string literals} in the
    QML environment.
\li gc() function: A QML function that manually triggers garbage collection.
\li print() function: A QML function that prints output to the console.
\li The \l{Console API}{console object}: Implements a subset of the
    \l{http://getfirebug.com/wiki/index.php/Console_API}{FireBug Console API}.
\li \l{XMLHttpRequest}, DOMException: Implements a subset of the
    \l{http://www.w3.org/TR/XMLHttpRequest/}{W3C XMLHttpRequest specification}.
\endlist

\note You cannot use the \l {QJSEngine::}{globalObject()} function to change
the global object of a \l QQmlEngine. For more information, see
\l {JavaScript Environment Restrictions}.

*/