diff options
author | Alessandro Portale <alessandro.portale@digia.com> | 2014-11-25 18:23:15 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@digia.com> | 2014-12-01 08:45:22 +0100 |
commit | 245ea90817014422bcce964d1b7aa8deeb7a981d (patch) | |
tree | b365f16244d78ffbb5c601561eae4bf23d391ffe /src | |
parent | b1dab6534069e78230f8469ba73da8e4d928ccee (diff) |
Qt Quick Compiler Support: Only allow valid settings
If the Qt Quick Compiler binary is not present in the binary tools
directory of the Qt version, disable the checkbox. A warning will
be added in the next minor version, sind we already have string
freeze.
QML debugging does not work when using the Qt Quick Compiler. So,
in case the Qt Quick Compiler is checked, let's disable the QML
debugging checkbox.
Change-Id: I739b1f71dc53aca9cf00e6ffd15246184d89816b
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qmakeprojectmanager/qmakestep.cpp | 19 | ||||
-rw-r--r-- | src/plugins/qtsupport/baseqtversion.cpp | 7 |
2 files changed, 17 insertions, 9 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 0d2f3836f1b..bc43f4bf8a6 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -66,7 +66,7 @@ const char QMAKE_BS_ID[] = "QtProjectManager.QMakeBuildStep"; const char QMAKE_ARGUMENTS_KEY[] = "QtProjectManager.QMakeBuildStep.QMakeArguments"; const char QMAKE_FORCED_KEY[] = "QtProjectManager.QMakeBuildStep.QMakeForced"; -const char QMAKE_USE_qtQuickCompiler[] = "QtProjectManager.QMakeBuildStep.UseqtQuickCompiler"; +const char QMAKE_USE_QTQUICKCOMPILER[] = "QtProjectManager.QMakeBuildStep.UseQtQuickCompiler"; const char QMAKE_QMLDEBUGLIBAUTO_KEY[] = "QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto"; const char QMAKE_QMLDEBUGLIB_KEY[] = "QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary"; } @@ -178,7 +178,7 @@ QStringList QMakeStep::deducedArguments() QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit()); arguments << QmakeBuildConfiguration::deduceArgumnetsForTargetAbi(targetAbi, version); - if (linkQmlDebuggingLibrary() && version) { + if (linkQmlDebuggingLibrary() && version && !useQtQuickCompiler()) { arguments << QLatin1String(Constants::QMAKEVAR_QUICK1_DEBUG); if (version->qtVersion().majorVersion >= 5) arguments << QLatin1String(Constants::QMAKEVAR_QUICK2_DEBUG); @@ -377,9 +377,6 @@ void QMakeStep::setLinkQmlDebuggingLibrary(bool enable) bool QMakeStep::useQtQuickCompiler() const { - const Core::Context languages = project()->projectLanguages(); - if (!languages.contains(ProjectExplorer::Constants::LANG_QMLJS)) - return false; return m_useQtQuickCompiler; } @@ -430,7 +427,7 @@ QVariantMap QMakeStep::toMap() const map.insert(QLatin1String(QMAKE_QMLDEBUGLIBAUTO_KEY), m_linkQmlDebuggingLibrary == DebugLink); map.insert(QLatin1String(QMAKE_QMLDEBUGLIB_KEY), m_linkQmlDebuggingLibrary == DoLink); map.insert(QLatin1String(QMAKE_FORCED_KEY), m_forced); - map.insert(QLatin1String(QMAKE_USE_qtQuickCompiler), m_useQtQuickCompiler); + map.insert(QLatin1String(QMAKE_USE_QTQUICKCOMPILER), m_useQtQuickCompiler); return map; } @@ -438,7 +435,7 @@ bool QMakeStep::fromMap(const QVariantMap &map) { m_userArgs = map.value(QLatin1String(QMAKE_ARGUMENTS_KEY)).toString(); m_forced = map.value(QLatin1String(QMAKE_FORCED_KEY), false).toBool(); - m_useQtQuickCompiler = map.value(QLatin1String(QMAKE_USE_qtQuickCompiler), false).toBool(); + m_useQtQuickCompiler = map.value(QLatin1String(QMAKE_USE_QTQUICKCOMPILER), false).toBool(); if (map.value(QLatin1String(QMAKE_QMLDEBUGLIBAUTO_KEY), false).toBool()) { m_linkQmlDebuggingLibrary = DebugLink; } else { @@ -524,6 +521,7 @@ void QMakeStepConfigWidget::qtVersionChanged() updateSummaryLabel(); updateEffectiveQMakeCall(); updateQmlDebuggingOption(); + updateQtQuickCompilerOption(); } void QMakeStepConfigWidget::qmakeBuildConfigChanged() @@ -561,11 +559,11 @@ void QMakeStepConfigWidget::useQtQuickCompilerChanged() { if (m_ignoreChange) return; -// m_ui->qtQuickCompilerCheckBox->setChecked(m_step->useQtQuickCompiler()); updateSummaryLabel(); updateEffectiveQMakeCall(); updateQtQuickCompilerOption(); + updateQmlDebuggingOption(); } void QMakeStepConfigWidget::qmakeArgumentsLineEdited() @@ -633,6 +631,7 @@ void QMakeStepConfigWidget::useQtQuickCompilerChecked(bool checked) updateSummaryLabel(); updateEffectiveQMakeCall(); + updateQmlDebuggingOption(); updateQtQuickCompilerOption(); } @@ -654,7 +653,9 @@ void QMakeStepConfigWidget::updateQmlDebuggingOption() { QString warningText; bool supported = QtSupport::BaseQtVersion::isQmlDebuggingSupported(m_step->target()->kit(), - &warningText); + &warningText) + && !m_step->useQtQuickCompiler(); + m_ui->qmlDebuggingLibraryCheckBox->setEnabled(supported); m_ui->debuggingLibraryLabel->setText(tr("Enable QML debugging:")); diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index bf89085e572..0038fa3eab6 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -1556,6 +1556,13 @@ bool BaseQtVersion::isQtQuickCompilerSupported(QString *reason) const return false; } + const QString qtQuickCompilerExecutable = + HostOsInfo::withExecutableSuffix(binPath().toString() + QLatin1String("/qtquickcompiler")); + if (!QFileInfo::exists(qtQuickCompilerExecutable)) { + // TODO: Add reason string in master + return false; + } + return true; } |