Setting Loader.active to false doesn't release item immediately

前端 未结 4 544
小鲜肉
小鲜肉 2020-12-22 09:05

I have a use case where depending on the presence or absence of a property value an object referencing it is either created or removed. I am using a Loader for

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-22 09:27

    It's not really a bug, but more like a technical limitation. A slot must not delete the sender of the connected signal. It must use deleteLater() to avoid that the execution returns to a deleted object. Essentially for the same reason, Loader cannot immediately delete the loaded item, because the active property might be bound to something that is controlled from within the loaded hierarchy of items.

提交回复
热议问题