forked from qt-creator/qt-creator
Utils: Move bool aspect to second column in forms by default
Also let the user opt out if necessary. Change-Id: Ia7483a3b3de1ce0c119e00594b722e38fa2d0bb2 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -229,6 +229,7 @@ struct ResultItem
|
||||
int space = -1;
|
||||
int stretch = -1;
|
||||
int span = 1;
|
||||
bool empty = false;
|
||||
};
|
||||
|
||||
struct Slice
|
||||
@@ -287,6 +288,8 @@ static void addItemToBoxLayout(QBoxLayout *layout, const ResultItem &item)
|
||||
layout->addSpacing(item.space);
|
||||
} else if (!item.text.isEmpty()) {
|
||||
layout->addWidget(createLabel(item.text));
|
||||
} else if (item.empty) {
|
||||
// Nothing to do, but no reason to warn, either.
|
||||
} else {
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
@@ -654,8 +657,8 @@ LayoutItem empty()
|
||||
LayoutItem item;
|
||||
item.onAdd = [](LayoutBuilder &builder) {
|
||||
ResultItem ri;
|
||||
ri.span = 1;
|
||||
builder.stack.last().pendingItems.append(ResultItem());
|
||||
ri.empty = true;
|
||||
builder.stack.last().pendingItems.append(ri);
|
||||
};
|
||||
return item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user