Skip to content
Snippets Groups Projects
Commit 404186a9 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlProject: Tell the code model about the target Qt's import path.

Task-number: QTCREATORBUG-2639
Reviewed-by: Thomas Hartmann
parent 6f41ebaf
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <projectexplorer/filewatcher.h> #include <projectexplorer/filewatcher.h>
#include <qt4projectmanager/qmldumptool.h> #include <qt4projectmanager/qmldumptool.h>
#include <qt4projectmanager/qtversionmanager.h>
#include <qmljs/qmljsmodelmanagerinterface.h> #include <qmljs/qmljsmodelmanagerinterface.h>
#include <QTextStream> #include <QTextStream>
...@@ -171,6 +172,21 @@ QStringList QmlProject::importPaths() const ...@@ -171,6 +172,21 @@ QStringList QmlProject::importPaths() const
QStringList importPaths; QStringList importPaths;
if (m_projectItem) if (m_projectItem)
importPaths = m_projectItem.data()->importPaths(); 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; return importPaths;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment