Commit f0a4ad1b authored by Victor Heng's avatar Victor Heng Committed by Victor Heng

JsonWizard: Hide label when widget is hidden in Field Page

Setting "visible" of a widget (such as TextField) to false in a Field
Page hides the widget, but leaves it's label visible. Modified each
field to update it's label visibility when the widget is shown/hidden.

Change-Id: Idf20c624b6aad09a2be159e2fc697fcb24bd2bc5
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <>
parent d381c6e0
......@@ -117,6 +117,7 @@ JsonFieldPage::Field::Field() : d(new FieldPrivate)
delete d->m_widget;
delete d->m_label;
delete d;
......@@ -178,12 +179,14 @@ void JsonFieldPage::Field::createWidget(JsonFieldPage *page)
QFormLayout *layout = page->layout();
if (suppressName())
if (suppressName()) {
else if (hasSpan())
} else if (hasSpan()) {
layout->addRow(displayName(), w);
} else {
d->m_label = new QLabel(displayName());
layout->addRow(d->m_label, w);
setup(page, name());
......@@ -205,6 +208,8 @@ void JsonFieldPage::Field::setEnabled(bool e)
void JsonFieldPage::Field::setVisible(bool v)
QTC_ASSERT(d->m_widget, return);
if (d->m_label)
......@@ -53,6 +53,7 @@ public:
QVariant m_isCompleteExpando;
QString m_isCompleteExpandoMessage;
QLabel *m_label = nullptr;
QWidget *m_widget = nullptr;
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