Commit e8d02209 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

JsonWizard: Add a way to check for existence of a variable



Change-Id: Ia1368334156c33ca270b5cc7d946efcdb7b635a8
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent d5b4dd65
......@@ -54,6 +54,13 @@ JsonWizard::JsonWizard(QWidget *parent) :
}
return v.isValid();
});
m_expander.registerPrefix("Exists", tr("Check whether a variable exists. Returns \"true\" if it does and an empty string if not."),
[this](const QString &value) -> QString
{
const QString key = QString::fromLatin1("%{") + value + QLatin1Char('}');
return m_expander.expand(key) == key ? QString() : QLatin1String("true");
});
}
JsonWizard::~JsonWizard()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment