RunConfigurationFactories: Fix crash opening non-qmake based projects

Make sure the Qnx RCs only get triggered for qmake-based projects and defend
against broken set-ups using QTC_ASSERT.

Task-number: QTCREATORBUG-19755
Change-Id: If64b73de49b0199308f767151d68909dc8b1bc53
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2018-03-07 10:35:08 +01:00
parent 23e48fe207
commit 6e419d642a
7 changed files with 20 additions and 9 deletions

View File

@@ -62,7 +62,8 @@ bool IosRunConfigurationFactory::canCreateHelper(Target *parent, const QString &
QList<BuildTargetInfo>
IosRunConfigurationFactory::availableBuildTargets(Target *parent, CreationMode mode) const
{
auto project = static_cast<QmakeProject *>(parent->project());
auto project = qobject_cast<QmakeProject *>(parent->project());
QTC_ASSERT(project, return {});
return project->buildTargets(mode, {ProjectType::ApplicationTemplate,
ProjectType::SharedLibraryTemplate,
ProjectType::AuxTemplate});