summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2022-10-25 12:34:17 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2022-10-31 17:30:25 +0300
commitc4c211c73c987dc267899a2084da98b87ff45340 (patch)
treef6f4d6e5b86969c75eb15d9e7b7c47864e3e06a0 /doc
parent5b4a085fb67730f387a9f0228dccc2e47d4e87be (diff)
Doc: add overview of using QObjects with the scripting API
This adds general description of using QObjects that are not part of the documented global JS objects exposed to the scripting API by IFW, as it is possible and often needed to achieve wanted functionality in the controller and component scripts. Change-Id: I3529f59d75d9e5d097e993602a5942d9bae9214f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'doc')
-rw-r--r--doc/noninteractive.qdoc15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/noninteractive.qdoc b/doc/noninteractive.qdoc
index 5576f93f3..15c85d28a 100644
--- a/doc/noninteractive.qdoc
+++ b/doc/noninteractive.qdoc
@@ -80,6 +80,21 @@
For more information about the JavaScript global objects that you can use
in control scripts, see \l{Scripting API}.
+ In addition to the predefined global objects, the scripting API supports working
+ with other objects derived from \c QObject. In the above code example the
+ \c{gui.currentPageWidget()} method returns a widget of type \c QWidget.
+
+ The scripting API makes use of Qt's object trees. Widgets derived from \c QObject export
+ their named child objects as properties for the JavaScript object, where the name of the
+ property is the same as the child object's \c{QObject::objectName}. The default properties
+ and their access functions of objects derived from \c QObject can also be used in the scripts.
+
+ For example, in the above code the \c MessageLabel object from class \c QLabel is a child
+ of the \c widget. The \c setText() is the setter access function for its \c QLabel::text property.
+
+ In addition to properties, the signals and public slots of objects derived from \c QObject
+ can be used in both controller and component scripts.
+
\section1 Predefined Installer Pages
The QInstaller JavaScript object provides access to the following predefined