| /**************************************************************************** |
| ** |
| ** Copyright (C) 2016 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$ |
| ** |
| ****************************************************************************/ |
| |
| /*! |
| \page topics-scripting.html |
| \title Scripting |
| \brief Qt's scripting features |
| |
| Qt has three main ways to help make an application scriptable. All of them allow easy |
| integration of the \l{ECMAScript Reference}{ECMAScript} (more widely known as JavaScript) language into the application. Depending on how deep |
| the integration should be, one of these APIs can be used: |
| |
| \section1 Qt Script Module |
| \l {Qt Script} is a separate module, designed with scripting applications in mind. It has |
| a mature and rich API that permits a really deep integration of scripting functionality. It allows |
| evaluating and debugging of scripts, and advanced use of objects and functions. It also gives access to a really |
| low level \l{ECMAScript Reference}{ECMAScript} engine API. Full documentation about using \l{Qt Script} to make an application |
| scriptable can be found \l{Making Applications Scriptable}{here}. |
| |
| \warning This module is not actively developed. It is provided for backwards |
| compatibility with Qt 4 only. For new code, use |
| \l {JS API}{QJSEngine and related classes} in the Qt QML module instead. |
| |
| \section1 JS API |
| This is a simple API, very similar to \l{Qt Script}, but limited to basic functionality. The main |
| classes are QJSEngine and QJSValue, which can be used to embed pure \l{ECMAScript Reference}{ECMAScript} functionality |
| like evaluating scripts and calling functions. |
| |
| \section1 QML |
| \l{Qt QML}{QML} exposes a modified \l{ECMAScript Reference}{ECMAScript} environment. It is designed to mix well with the JavaScript |
| API mentioned earlier. QML may be used without \l{Qt Quick} components, which may be useful for |
| server side scripting. With QML it is possible to mix pure \l{ECMAScript Reference}{ECMAScript} and declarative components |
| (\l{Use Case - Integrating JavaScript in QML}). |
| |
| All of these three scripting solutions seamlessly inter-operate with \l{The Meta-Object System}{the Meta-Object System}, which means that all \l{Signals & Slots}{signals and slots} and |
| \l{The Property System}{properties} of a QObject instance are accessible in an \l{ECMAScript Reference}{ECMAScript} environment. |
| */ |