1 files changed, 4 insertions, 3 deletions
diff --git a/src/timeline/DelegateChooser.cpp b/src/timeline/DelegateChooser.cpp
index ad734895..151510b6 100644
--- a/src/timeline/DelegateChooser.cpp
+++ b/src/timeline/DelegateChooser.cpp
@@ -53,7 +53,8 @@ DelegateChooser::setRoleValue(const QVariant &value)
{
if (value != roleValue_) {
roleValue_ = value;
- recalcChild();
+ if (isComponentComplete())
+ recalcChild();
emit roleValueChanged();
}
}
@@ -96,8 +97,8 @@ void
DelegateChooser::recalcChild()
{
for (const auto choice : qAsConst(choices_)) {
- auto choiceValue = choice->roleValue();
- if (!roleValue_.isValid() || !choiceValue.isValid() || choiceValue == roleValue_) {
+ const auto &choiceValue = choice->roleValueRef();
+ if (choiceValue == roleValue_ || (!choiceValue.isValid() && !roleValue_.isValid())) {
if (child_) {
child_->setParentItem(nullptr);
child_ = nullptr;
|