diff options
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 8 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 5058d4d..3e570e5 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1790,7 +1790,13 @@ void QDeclarativeEngine::addImportPath(const QString& path) if (qmlImportTrace()) qDebug() << "QDeclarativeEngine::addImportPath" << path; Q_D(QDeclarativeEngine); - d->fileImportPath.prepend(path); + QUrl url = QUrl(path); + if (url.isRelative() || url.scheme() == QString::fromLocal8Bit("file")) { + QDir dir = QDir(path); + d->fileImportPath.prepend(dir.canonicalPath()); + } else { + d->fileImportPath.prepend(path); + } } diff --git a/tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp b/tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp index 879047e..412c3b7 100644 --- a/tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp +++ b/tests/auto/declarative/qdeclarativelayouts/tst_qdeclarativelayouts.cpp @@ -130,7 +130,7 @@ void tst_QDeclarativeLayouts::test_qml() void tst_QDeclarativeLayouts::test_cpp() { - //TODO: Waiting on QT-2407 to write this test + //TODO: This test! } QDeclarativeView *tst_QDeclarativeLayouts::createView(const QString &filename) |