From 35cc7e709f6c93a20a453d697f0da76cd9f05e1f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor <alexandru.croitor@qt.io> Date: Wed, 7 Feb 2018 15:17:53 +0100 Subject: [PATCH] Add documentation about using Qt Quick Compiler with qrc .js files Application developer need to make sure that they skip processing .js files by the Qt Quick Compiler, if the files will be loaded inside HTML pages. Task-number: QTBUG-66155 Change-Id: I09a3c6fa1f31b60a09d30012c6e15ae872bac639 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> --- src/webengine/doc/src/qtwebengine-deploying.qdoc | 14 ++++++++++++++ src/webengine/doc/src/qtwebengine-overview.qdoc | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/src/webengine/doc/src/qtwebengine-deploying.qdoc b/src/webengine/doc/src/qtwebengine-deploying.qdoc index 8530bc075..c9f0f3580 100644 --- a/src/webengine/doc/src/qtwebengine-deploying.qdoc +++ b/src/webengine/doc/src/qtwebengine-deploying.qdoc @@ -141,4 +141,18 @@ directory specified by QLibraryInfo::location(QLibraryInfo::TranslationsPath) \endlist + + \section2 JavaScript Files in Qt Resource Files + + If your WebEngine application is built using the Qt Quick Compiler, and the application ships + JavaScript files inside .qrc resources, and these files are supposed to be loaded from inside + HTML pages, make sure to specify the resource files in a \c QTQUICK_COMPILER_SKIPPED_RESOURCES + qmake variable inside your project. This prevents the Qt Quick Compiler from trying to generate + C++ code for the corresponding JavaScript code, as well as removing the original JavaScript code + from the Qt resources file, which would lead to broken HTML pages. For example: + + \code + QTQUICK_COMPILER_SKIPPED_RESOURCES += resources/my_resource.qrc + \endcode + */ diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index 904e4a551..ccba74504 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -205,6 +205,10 @@ window.alert("Page is from qt.io, but not wiki.qt.io"); \endcode + If your WebEngine application is built using the Qt Quick Compiler, and the application ships + JavaScript files inside .qrc resources, consider reading the section + \l{JavaScript Files in Qt Resource Files}. + \section1 Managing Certificates Qt WebEngine uses its own network stack, and therefore QSslConfiguration is not used to -- GitLab