qtdeclarative/tools
Fabian Kosmale 8effdd97d9 Expose XMLHttpRequest to qmltypes
In QML, one can use XMLHttpRequest. Not so with a plain JS engine. The
reason for that lies in the fact that a JS engine did not have any
network access, because all network functionality was in the type
loader, and the type loader was coupled to the QV4::Engine.
This has changed in d2bc4a4330, but we
stil don't expose XMLHttpRequest to a plain QJSEngine.

Nevertheless, it conceptually lives in the global object, and we need to
collect information about it to enable code completion and linting.

Consequently, expose a function in QV4::Engine, which allows us to
manually trigger the registration, and call it in qmljsrootgen.

Going forward, we should arguably have a QJSEngine::Extension for
XMLHttpReuqest, after which we could remove the hack.

Note that as before, qmljsrootgen prints a few warnings, because we call
functions in contexts in which they must not be called. As before, we
ignore this for now.

As a side-effect, this adds a few more entries to the qmltypes file for
new entries on the global Qt object.

Task-number: QTBUG-137075
Pick-to: 6.10
Change-Id: I21e9d62bf075e8d4356db8f357502feb927717e7
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2025-07-22 10:18:31 +02:00
..
qml Adjust to QUnifiedTimer slow mode changes 2025-06-27 19:27:12 +08:00
qmlaotstats aotstats: Fix coverity warnings 2024-11-07 20:06:01 +01:00
qmlcachegen CMake: Fix installation of qmlcache's .prf files in cross-builds 2025-01-03 11:57:39 +01:00
qmldom DOM refactoring. Remove LoadOptions 2024-01-30 17:14:09 +01:00
qmleasing Remove Qt keywords from all headers 2022-12-09 11:55:10 +08:00
qmlformat qmlformat: move configuration functions into library 2025-01-29 20:37:46 +01:00
qmlimportscanner qmlimportscanner: Optionally add version to output again 2025-07-08 11:50:09 +02:00
qmljs QtQml: Don't use loadModule in qmljs 2025-06-18 08:05:17 +02:00
qmljsrootgen Expose XMLHttpRequest to qmltypes 2025-07-22 10:18:31 +02:00
qmllint QQmlJSLinter: add crude context properties warnings 2025-05-22 09:19:51 +02:00
qmlls qmlls: add --version command line parameter 2025-04-23 07:36:04 +01:00
qmlplugindump QtQml: Hold QQmlTypeLoader in QV4::ExecutionEngine 2025-06-17 07:00:33 +02:00
qmlpreview Remove Qt keywords from all headers 2022-12-09 11:55:10 +08:00
qmlprofiler qmlprofiler: Fix data sorting 2024-01-25 18:35:05 +01:00
qmlscene Adjust to QUnifiedTimer slow mode changes 2025-06-27 19:27:12 +08:00
qmltc qmltc: Cleanly reject custom parsed properties 2025-04-15 19:27:07 +02:00
qmltestrunner CMake: Force-build qmltestrunner when cross-compiling 2025-06-17 18:44:38 +02:00
qmltime Remove all QML_DECLARE_TYPE from src and tools 2023-11-18 07:37:33 +00:00
qmltyperegistrar qmake: Don't pass empty foreign-types list to qmltyperegistrar 2025-02-25 19:46:08 +01:00
svgtoqml Add assumeTrustedSource property to VectorImage 2025-05-30 18:34:09 +02:00
CMakeLists.txt Improve builds for non-threaded qt 2025-05-20 15:04:51 +00:00