From 8d6e3d22a9bac6022e8158f935c4be3e875b5b82 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 5 Mar 2014 15:17:43 +0100 Subject: [PATCH] QmlDesigner.DesignDocument: Fixing getActiveQtVersion() The function currentProject() returns the current project based on the current project node. If the current document was newly created by a wizard, this did not work. We use SessionManager::projectForFile() as a fallback. For Qt Creator 3.2 we plan to unify this functionality with die Qml code model. Change-Id: I296224671a0b496fbf6fd0d8e62e74c28b4f9abb Reviewed-by: Marco Bubke --- .../qmldesigner/components/integration/designdocument.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp index 973265738a7..e31c1147b5d 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -651,6 +652,9 @@ static inline QtSupport::BaseQtVersion *getActiveQtVersion(DesignDocument *desig ProjectExplorer::ProjectExplorerPlugin *projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance(); ProjectExplorer::Project *currentProject = projectExplorer->currentProject(); + if (!currentProject) + currentProject = ProjectExplorer::SessionManager::projectForFile(designDocument->fileName()); + if (!currentProject) return 0;