diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 83486bbaf99d7c172d339f2bb57f4b0477068277..e74f2683b29906a0843ac1ced9b7fe7b9cdbea03 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -38,6 +38,7 @@ #include <extensionsystem/pluginmanager.h> #include <projectexplorer/filewatcher.h> #include <qt4projectmanager/qmldumptool.h> +#include <qt4projectmanager/qtversionmanager.h> #include <qmljs/qmljsmodelmanagerinterface.h> #include <QTextStream> @@ -171,6 +172,21 @@ QStringList QmlProject::importPaths() const QStringList importPaths; if (m_projectItem) importPaths = m_projectItem.data()->importPaths(); + + // add the default import path for the target Qt version + if (activeTarget()) { + const QmlProjectRunConfiguration *runConfig = + qobject_cast<QmlProjectRunConfiguration*>(activeTarget()->activeRunConfiguration()); + if (runConfig) { + const Qt4ProjectManager::QtVersion *qtVersion = runConfig->qtVersion(); + if (qtVersion && qtVersion->isValid()) { + const QString qtVersionImportPath = qtVersion->versionInfo().value("QT_INSTALL_IMPORTS"); + if (!qtVersionImportPath.isEmpty()) + importPaths += qtVersionImportPath; + } + } + } + return importPaths; }