diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index ecc8f8b99d2..33d8f9947b5 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -776,12 +776,6 @@ QString QmlEngine::toFileInProject(const QString &fileUrl) return sourcePath; } - // Try whether file is absolute & exists - if (QFileInfo(path).isAbsolute() - && QFileInfo(path).exists()) { - return path; - } - if (d->fileFinder.projectDirectory().isEmpty()) d->fileFinder.setProjectDirectory(startParameters().projectDir); @@ -790,6 +784,13 @@ QString QmlEngine::toFileInProject(const QString &fileUrl) QString fileInProject = d->fileFinder.findFile(path, &fileFound); if (fileFound) return fileInProject; + + // Try whether file is absolute & exists + if (QFileInfo(path).isAbsolute() + && QFileInfo(path).exists()) { + return path; + } + return fileUrl; } diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp index 189bccd4a27..d2c662d8927 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include #include #include @@ -204,6 +206,7 @@ RunControl *QmlRunControlFactory::createDebugRunControl(QmlProjectRunConfigurati params.workingDirectory = runConfig->workingDirectory(); params.environment = runConfig->environment(); params.displayName = runConfig->displayName(); + params.projectDir = runConfig->target()->project()->projectDirectory(); if (params.executable.isEmpty()) { showQmlObserverToolWarning();