summaryrefslogtreecommitdiff
path: root/src/controls/controls.pro
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@digia.com>2013-07-31 13:51:58 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-21 13:10:10 +0200
commitb2e5d1acb1aca93157a6d4d0a026153134f9ad01 (patch)
tree8b095329722d5781e3499a12bdc1534a0863dfa0 /src/controls/controls.pro
parentffbf8d724f39e9c8d05ae2049e8b79a61570e235 (diff)
downloadqtquickcontrols-b2e5d1acb1aca93157a6d4d0a026153134f9ad01.tar.gz
Add qml/js files in resource
All the qml and js files are embedded in the Qt Quick Controls plugin (for Controls, Styles and Private). If ApplicationWindow.qml is missing, loading the files from resource will be enabled. Otherwise, the files will be loaded from the local path. The purpose of this change is to make the deployment of Qt Quick Controls easier while keeping the development tasks convenient. With this solution: - It is only necessary to deploy the qmldir and the plugin qtquickcontrolsplugin found in the QtQuick/Controls folder. - By default the files used are the ones found in the local folder. Autocompletion and debugging capabilities remain unchanged. Task-number: QTBUG-31565 Change-Id: I938ebe261c3c35f9e3b066d82c81accd9750edc9 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/controls.pro')
-rw-r--r--src/controls/controls.pro27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/controls/controls.pro b/src/controls/controls.pro
index 78eadf36..38018353 100644
--- a/src/controls/controls.pro
+++ b/src/controls/controls.pro
@@ -45,5 +45,32 @@ include(Styles/styles.pri)
osx: LIBS += -framework Carbon
+# Create the resource file
+GENERATED_RESOURCE_FILE = $$OUT_PWD/controls.qrc
+
+INCLUDED_RESOURCE_FILES = \
+ $$CONTROLS_QML_FILES \
+ $$PRIVATE_QML_FILES \
+ $$STYLES_QML_FILES
+
+RESOURCE_CONTENT = \
+ "<RCC>" \
+ "<qresource prefix=\"/QtQuick/Controls\">"
+
+for(resourcefile, INCLUDED_RESOURCE_FILES) {
+ resourcefileabsolutepath = $$absolute_path($$resourcefile)
+ relativepath_in = $$relative_path($$resourcefileabsolutepath, $$_PRO_FILE_PWD_)
+ relativepath_out = $$relative_path($$resourcefileabsolutepath, $$OUT_PWD)
+ RESOURCE_CONTENT += "<file alias=\"$$relativepath_in\">$$relativepath_out</file>"
+}
+
+RESOURCE_CONTENT += \
+ "</qresource>" \
+ "</RCC>"
+
+write_file($$GENERATED_RESOURCE_FILE, RESOURCE_CONTENT)|error("Aborting.")
+
+RESOURCES += $$GENERATED_RESOURCE_FILE
+
CONFIG += no_cxx_module
load(qml_plugin)