Get rid of redundant constructions and make room implicit

This commit is contained in:
Nicolas Werner 2023-07-28 20:05:47 +02:00
parent 466d3cd52c
commit 718a58d388
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
6 changed files with 28 additions and 10 deletions

View file

@ -84,7 +84,8 @@ void
EventDelegateChooser::componentComplete()
{
QQuickItem::componentComplete();
// eventIncubator.reset(eventIndex);
eventIncubator.reset(eventId_);
replyIncubator.reset(replyId);
// eventIncubator.forceCompletion();
}
@ -226,6 +227,9 @@ EventDelegateChooser::DelegateIncubator::reset(QString id)
for (const auto choice : qAsConst(chooser.choices_)) {
const auto &choiceValue = choice->roleValues();
if (choiceValue.contains(role) || choiceValue.empty()) {
nhlog::ui()->debug(
"Instantiating type: {}, c {}", (int)role, choiceValue.contains(role));
if (auto child = qobject_cast<QQuickItem *>(object())) {
child->setParentItem(nullptr);
}