forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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:"));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user