forked from qt-creator/qt-creator
JSON wizards: Fix "span" with combo boxes
Combo boxes have "suppressName" set, but if they have span set too, we still need to use addRow instead of addWidget. Reorder the if conditions. The previous code didn't make much sense, because it first checked for suppressName, and then for hasSpan, but inside hasSpan it checked for (!suppressName) again, which could never be false. You can see this in action in the File > Qt > JS File wizard. Change-Id: I976227f80277642823620e41aba605c8570aed44 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -210,15 +210,15 @@ void JsonFieldPage::Field::createWidget(JsonFieldPage *page)
|
||||
w->setObjectName(name());
|
||||
QFormLayout *layout = page->layout();
|
||||
|
||||
if (suppressName()) {
|
||||
layout->addWidget(w);
|
||||
} else if (hasSpan()) {
|
||||
if (hasSpan()) {
|
||||
if (!suppressName()) {
|
||||
d->m_label = new QLabel(displayName());
|
||||
layout->addRow(d->m_label);
|
||||
}
|
||||
|
||||
layout->addRow(w);
|
||||
} else if (suppressName()) {
|
||||
layout->addWidget(w);
|
||||
} else {
|
||||
d->m_label = new QLabel(displayName());
|
||||
layout->addRow(d->m_label, w);
|
||||
|
Reference in New Issue
Block a user