summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2020-04-07 09:39:41 +0200
committerAndy Shaw <andy.shaw@qt.io>2020-05-14 13:50:04 +0200
commit6034066c6e95db1a7ec019194c36a5d7f339a79a (patch)
treed158570ecdaad3c3efaee50f28f0bb6d95ac2ab7
parenta15f2b83c42286ab7f4b4c406e4795b6a1a9a13e (diff)
Dynamically create the qrc file so it has the right alias
If the qrc file is created via the qml_module.prf then it takes the path to the file as part of the alias and therefore this is in the wrong place when it is loaded statically. So we need to create the qrc file dynamically as well so that it correctly locates the qmldir at the right location. Change-Id: I620febf818a335319dafd6e5d53329b856369d68 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
-rw-r--r--src/imports/imports.pro8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index feeb9f1..aab25ed 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -14,5 +14,13 @@ DYNAMIC_QMLDIR = \
"classname QWebViewModule"
qtHaveModule(webengine):DYNAMIC_QMLDIR += "depends QtWebEngine 1.0"
load(qml_plugin)
+webview_qrc = \
+ "<!DOCTYPE RCC><RCC version=\"1.0\">" \
+ "<qresource prefix=\"/qt-project.org/imports/QtWebView\">" \
+ "<file alias=\"qmldir\">$$OUT_PWD/qmldir</file>" \
+ "</qresource>" \
+ "</RCC>"
+write_file($$OUT_PWD/qmake_QtWebView.qrc, webview_qrc)|error()
+RESOURCES = $$OUT_PWD/qmake_QtWebView.qrc
OTHER_FILES += qmldir