diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-06-24 10:00:28 +0200 |
---|---|---|
committer | Caroline Chao <caroline.chao@theqtcompany.com> | 2015-05-12 14:45:47 +0000 |
commit | d63da9df3ca50c3c234b2622aa1d892d9ca27676 (patch) | |
tree | 72d0e644ed305cb25b8fe1a07bf94dc94fd36e04 /src/controls | |
parent | f7b3f11b47768f47f625874c1bd45da4296c0f82 (diff) | |
download | qtquickcontrols-d63da9df3ca50c3c234b2622aa1d892d9ca27676.tar.gz |
Add support for compiling QML files ahead of time
All this patch really does it not try to load any .qml files off the disk but
always load from qrc.
Change-Id: Ie0e1252605486b627d8d42156736734f13bb5ff9
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/controls')
-rw-r--r-- | src/controls/Private/private.pri | 2 | ||||
-rw-r--r-- | src/controls/Styles/styles.pri | 2 | ||||
-rw-r--r-- | src/controls/controls.pro | 3 | ||||
-rw-r--r-- | src/controls/plugin.cpp | 4 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/controls/Private/private.pri b/src/controls/Private/private.pri index 1e66f9ba..24d1fc53 100644 --- a/src/controls/Private/private.pri +++ b/src/controls/Private/private.pri @@ -70,4 +70,4 @@ PRIVATE_QML_FILES += \ $$PWD/TreeViewItemDelegateLoader.qml \ $$PWD/qmldir -QML_FILES += $$PRIVATE_QML_FILES +!qtquickcompiler: QML_FILES += $$PRIVATE_QML_FILES diff --git a/src/controls/Styles/styles.pri b/src/controls/Styles/styles.pri index eaad43ea..74dbd67b 100644 --- a/src/controls/Styles/styles.pri +++ b/src/controls/Styles/styles.pri @@ -110,4 +110,4 @@ STYLES_QML_FILES += \ STYLES_QML_FILES += $$PWD/qmldir -QML_FILES += $$STYLES_QML_FILES +!qtquickcompiler: QML_FILES += $$STYLES_QML_FILES diff --git a/src/controls/controls.pro b/src/controls/controls.pro index 7261b5c6..7dd176f0 100644 --- a/src/controls/controls.pro +++ b/src/controls/controls.pro @@ -38,7 +38,8 @@ CONTROLS_QML_FILES = \ ToolBar.qml \ ToolButton.qml -QML_FILES += $$CONTROLS_QML_FILES +!qtquickcompiler: QML_FILES += $$CONTROLS_QML_FILES +qtquickcompiler: DEFINES += ALWAYS_LOAD_FROM_RESOURCES SOURCES += $$PWD/plugin.cpp HEADERS += $$PWD/plugin.h diff --git a/src/controls/plugin.cpp b/src/controls/plugin.cpp index 7e98509d..e6868569 100644 --- a/src/controls/plugin.cpp +++ b/src/controls/plugin.cpp @@ -188,11 +188,15 @@ QString QtQuickControlsPlugin::fileLocation() const bool QtQuickControlsPlugin::isLoadedFromResource() const { +#if defined(ALWAYS_LOAD_FROM_RESOURCES) + return true; +#else // If one file is missing, it will load all the files from the resource QFile file(baseUrl().toLocalFile() + "/ApplicationWindow.qml"); if (!file.exists()) return true; return false; +#endif } QT_END_NAMESPACE |