Utils: Improve handling of BoolAspects used for checked QGroupBoxes

Make the group box a registered subwidget of the BoolAspect, so it
properly triggers the necessary behavior in BaseAspect::isDirty.

Change-Id: I9f6291d87ef7ce4067e0d235de8b5be24de79a93
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-04-06 11:51:14 +02:00
parent b63b84b83c
commit ba06114afa
3 changed files with 20 additions and 5 deletions

View File

@@ -451,9 +451,8 @@ Group::Group(std::initializer_list<LayoutItem> items)
box->setObjectName(item.specialValue.toString());
if (auto check = qobject_cast<BoolAspect *>(item.aspect)) {
box->setCheckable(true);
QObject::connect(box, &QGroupBox::clicked, box, [check](bool on) {
check->setValue(on);
});
box->setChecked(check->value());
check->setHandlesGroup(box);
}
} else {
builder.addItem(item);