ProjectManagers: Detect Qt by kit for code-model update

Change-Id: Idf5f8233e4457bb22437d442732432acf0ce313e
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-04-21 09:08:07 +03:00
committed by Orgad Shaneh
parent b192d18e04
commit 4896bb41e9
3 changed files with 35 additions and 0 deletions

View File

@@ -53,6 +53,8 @@
#include <cpptools/cppmodelmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/icontext.h>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h>
#include <utils/qtcassert.h>
#include <utils/filesystemwatcher.h>
@@ -408,6 +410,16 @@ void AutotoolsProject::updateCppCodeModel()
CppTools::ProjectInfo pInfo(this);
CppTools::ProjectPartBuilder ppBuilder(pInfo);
CppTools::ProjectPart::QtVersion activeQtVersion = CppTools::ProjectPart::NoQt;
if (QtSupport::BaseQtVersion *qtVersion =
QtSupport::QtKitInformation::qtVersion(activeTarget()->kit())) {
if (qtVersion->qtVersion() < QtSupport::QtVersionNumber(5,0,0))
activeQtVersion = CppTools::ProjectPart::Qt4;
else
activeQtVersion = CppTools::ProjectPart::Qt5;
}
ppBuilder.setQtVersion(activeQtVersion);
const QStringList cflags = m_makefileParserThread->cflags();
QStringList cxxflags = m_makefileParserThread->cxxflags();
if (cxxflags.isEmpty())