From 605d54e65a6e7a79afda0173cbce5346985903ab Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 7 Feb 2018 15:01:02 +0100 Subject: Prevent Qt Quick Compiler from removing qrc Javascript source code By default whenever a Qt application is built with Qt Quick compiler, it will scan all qrc resources for javascript files, generate corresponding C++ code, and remove the original JS code. This is problematic for web pages that are loaded in WebEngine because the pages won't be able to access the javascript code, and silently fail (or if you are lucky, you will get some unrelated "can not be found" error). Use the undocumented QtQuick Compiler QTQUICK_COMPILER_SKIPPED_RESOURCES qmake variable to specify that Javascript source code found in qrc files should be left as is. Task-number: QTBUG-66155 Change-Id: Ib1dc744901baddd9e0c17c53db1ffede5c31e544 Reviewed-by: Simon Hausmann --- examples/webenginewidgets/contentmanipulation/contentmanipulation.pro | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'examples/webenginewidgets/contentmanipulation/contentmanipulation.pro') diff --git a/examples/webenginewidgets/contentmanipulation/contentmanipulation.pro b/examples/webenginewidgets/contentmanipulation/contentmanipulation.pro index 2ac97d487..e0b568df0 100644 --- a/examples/webenginewidgets/contentmanipulation/contentmanipulation.pro +++ b/examples/webenginewidgets/contentmanipulation/contentmanipulation.pro @@ -5,6 +5,10 @@ SOURCES = main.cpp \ mainwindow.cpp RESOURCES = jquery.qrc +# Disable Qt Quick compiler because the example doesn't use QML, but more importantly so that +# the source code of the .js files is not removed from the embedded qrc file. +CONFIG -= qtquickcompiler + # install target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/contentmanipulation INSTALLS += target -- cgit v1.2.3