Commit 63373ecc authored by Tobias Hunger's avatar Tobias Hunger
Browse files

JsonFieldPage: Support tooltips for all fields



Change-Id: Ie84e659d7cecf68753056db63a389173d725ebe4
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@theqtcompany.com>
parent 5d05db8d
......@@ -55,6 +55,7 @@ using namespace Utils;
const char NAME_KEY[] = "name";
const char DISPLAY_NAME_KEY[] = "trDisplayName";
const char TOOLTIP_KEY[] = "trToolTip";
const char MANDATORY_KEY[] = "mandatory";
const char VISIBLE_KEY[] = "visible";
const char ENABLED_KEY[] = "enabled";
......@@ -162,6 +163,7 @@ JsonFieldPage::Field *JsonFieldPage::Field::parse(const QVariant &input, QString
return 0;
}
data->name = name;
data->toolTip = tmp.value(QLatin1String(TOOLTIP_KEY)).toString();
data->m_visibleExpression = tmp.value(QLatin1String(VISIBLE_KEY), true);
data->m_enabledExpression = tmp.value(QLatin1String(ENABLED_KEY), true);
......@@ -204,6 +206,8 @@ void JsonFieldPage::Field::adjustState(MacroExpander *expander)
{
setVisible(JsonWizard::boolFromVariant(m_visibleExpression, expander));
setEnabled(JsonWizard::boolFromVariant(m_enabledExpression, expander));
QTC_ASSERT(m_widget, return);
m_widget->setToolTip(expander->expand(toolTip));
}
bool JsonFieldPage::Field::validate(MacroExpander *expander, QString *message)
......
......@@ -80,6 +80,7 @@ public:
QString name;
QString displayName;
QString toolTip;
bool mandatory;
bool span;
......
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