diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-01-23 12:36:29 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-01-23 12:36:29 +0100 |
commit | 03fe99ba3a7d29b1606660baa407cff21c4d4d35 (patch) | |
tree | 525d5f03e8703bf7e9a7851280de67a597dceea1 /src/qml/qml/qqmlapplicationengine.cpp | |
parent | f02e234fc012f4430378bc5205f32914822e4dff (diff) | |
parent | 94e6106d357ca5a1349a2b10a69dd84db34065c8 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Change-Id: I762e578aaf14a77efa26ce3fda2abb0e335003ea
Diffstat (limited to 'src/qml/qml/qqmlapplicationengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlapplicationengine.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp index 8a97b7eba7..2a96d96302 100644 --- a/src/qml/qml/qqmlapplicationengine.cpp +++ b/src/qml/qml/qqmlapplicationengine.cpp @@ -190,9 +190,14 @@ void QQmlApplicationEnginePrivate::_q_finishLoad(QObject *o) /*! \fn QQmlApplicationEngine::objectCreated(QObject *object, const QUrl &url) - This signal is emitted when an object finishes loading. If loading was successful, \a object contains a pointer to the loaded object. - Otherwise the pointer is NULL. The \a url loaded is also provided, note that if a QString file path was initially passed to the - QQmlApplicationEngine, this url will be the equivalent of QUrl::fromLocalFile(filePath). + This signal is emitted when an object finishes loading. If loading was + successful, \a object contains a pointer to the loaded object, otherwise + the pointer is NULL. + + The \a url to the component the \a object came from is also provided. + + \note If the path to the component was provided as a QString containing a + relative path, the \a url will contain a fully resolved path to the file. */ /*! @@ -226,7 +231,7 @@ QQmlApplicationEngine::QQmlApplicationEngine(const QUrl &url, QObject *parent) This is provided as a convenience, and is the same as using the empty constructor and calling load afterwards. */ QQmlApplicationEngine::QQmlApplicationEngine(const QString &filePath, QObject *parent) - : QQmlApplicationEngine(QUrl::fromLocalFile(filePath), parent) + : QQmlApplicationEngine(QUrl::fromUserInput(filePath, QLatin1String("."), QUrl::AssumeLocalFile), parent) { } @@ -265,7 +270,7 @@ void QQmlApplicationEngine::load(const QUrl &url) void QQmlApplicationEngine::load(const QString &filePath) { Q_D(QQmlApplicationEngine); - d->startLoad(QUrl::fromLocalFile(filePath)); + d->startLoad(QUrl::fromUserInput(filePath, QLatin1String("."), QUrl::AssumeLocalFile)); } /*! |