CMakePM: Fix handling of qml debugging

Add a respective aspect to the build configuration
for handling qml debugging from the build side
similar to what we do with qmake and qbs.

Qml debugging needs to get enabled on the build side
before the settings on the run configuration page
has an effect.

Fixes: QTCREATORBUG-23541
Change-Id: I86267747601015760737d8b21978712896892a37
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Stenger
2020-02-05 15:16:04 +01:00
parent 11abdb9ddc
commit 54cd881a40
6 changed files with 74 additions and 2 deletions

View File

@@ -47,6 +47,7 @@
#include <projectexplorer/target.h>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtbuildaspects.h>
#include <qtsupport/qtkitinformation.h>
#include <utils/algorithm.h>
@@ -157,6 +158,12 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Core::Id id)
setConfigurationForCMake(config);
});
const auto qmlDebuggingAspect = addAspect<QtSupport::QmlDebuggingAspect>();
qmlDebuggingAspect->setKit(target->kit());
connect(qmlDebuggingAspect, &QtSupport::QmlDebuggingAspect::changed,
this, &CMakeBuildConfiguration::configurationForCMakeChanged);
}
CMakeBuildConfiguration::~CMakeBuildConfiguration()
@@ -381,6 +388,11 @@ void CMakeBuildConfiguration::setWarning(const QString &message)
emit warningOccured(m_warning);
}
bool CMakeBuildConfiguration::isQmlDebuggingEnabled() const
{
return aspect<QtSupport::QmlDebuggingAspect>()->setting() == TriState::Enabled;
}
QString CMakeBuildConfiguration::error() const
{