diff options
author | Alan Alpert <aalpert@blackberry.com> | 2013-07-05 14:31:06 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-20 01:08:53 +0200 |
commit | 67ee1cd27b5e951e782e49edf382e8e7d8ee431f (patch) | |
tree | ccd28910830fedd30732156d350563c5a29ed762 /src/qml/qml/qqmlapplicationengine.cpp | |
parent | a5052ea1e7286aee60e2e138a405d9864750db24 (diff) |
Apply file selectors to QQmlApplicationEngine apps
You can also manually apply them to a QQmlEngine using
setUrlInterceptor(new QQmlFileSelector(parent)), or using
your own QQmlAbstractUrlInterceptor subclass.
Change-Id: I0c0ff8b080c138686b3c03e0bc3b9f25bcd11a85
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlapplicationengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlapplicationengine.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp index 85aeaf5786..3f13f8a140 100644 --- a/src/qml/qml/qqmlapplicationengine.cpp +++ b/src/qml/qml/qqmlapplicationengine.cpp @@ -44,6 +44,7 @@ #include <QQmlComponent> #include "qqmlapplicationengine.h" #include "qqmlapplicationengine_p.h" +#include "qqmlfileselector.h" QT_BEGIN_NAMESPACE @@ -76,6 +77,7 @@ void QQmlApplicationEnginePrivate::init() QCoreApplication::installTranslator(qtTranslator); translators << qtTranslator; #endif + q->setUrlInterceptor(new QQmlFileSelector(q)); QCoreApplication::instance()->setProperty("__qml_using_qqmlapplicationengine", QVariant(true)); } @@ -172,13 +174,12 @@ void QQmlApplicationEnginePrivate::_q_finishLoad(QObject *o) \li Connecting Qt.quit() to QCoreApplication::quit() \li Automatically loads translation files from an i18n directory adjacent to the main QML file. \li Automatically sets an incubuation controller if the scene contains a QQuickWindow. + \li Automatically sets a \c QQmlFileSelector as the url interceptor, applying file selectors to all + QML files and assets. \endlist The engine behavior can be further tweaked by using the inherited methods from QQmlEngine. - \note In the future QQmlApplicationEngine may automatically apply file selectors. - To ensure forwards compatibility, do not use folder names containing a '+' character in your QML file - structure. */ /*! |