OSDN Git Service

Qt4Project: Push the Qt version's QML import path to the code model.
authorChristian Kamm <christian.d.kamm@nokia.com>
Wed, 13 Oct 2010 11:05:36 +0000 (13:05 +0200)
committerChristian Kamm <christian.d.kamm@nokia.com>
Wed, 13 Oct 2010 11:31:31 +0000 (13:31 +0200)
Task-number: QTCREATORBUG-2639
Reviewed-by: dt
src/plugins/qt4projectmanager/qt4project.cpp

index 408a259..b1fbc90 100644 (file)
@@ -587,6 +587,14 @@ void Qt4Project::updateQmlJSCodeModel()
     foreach (Qt4ProFileNode *node, proFiles) {
         projectInfo.importPaths.append(node->variableValue(QmlImportPathVar));
     }
+    if (activeTarget() && activeTarget()->activeBuildConfiguration()) {
+        const QtVersion *qtVersion = activeTarget()->activeBuildConfiguration()->qtVersion();
+        if (qtVersion->isValid()) {
+            const QString qtVersionImportPath = qtVersion->versionInfo().value("QT_INSTALL_IMPORTS");
+            if (!qtVersionImportPath.isEmpty())
+                projectInfo.importPaths += qtVersionImportPath;
+        }
+    }
     projectInfo.importPaths.removeDuplicates();
 
     if (projectInfo.qmlDumpPath.isNull()) {