Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.15.0
-
None
-
-
3aa4cd682f52b70803cc3f72d732bde9987677dd (qt/qtdeclarative/dev) 3d195d33ece3f8fd7cd7d8e6163fe038fc7fc036 (qt/qtdeclarative/dev) d535b85a84ee89530a80b606701910a90681bdce (qt/qtdeclarative/5.15)
Description
I have found the status property of the Loader component contradicts the expectation while unloading in two cases. Please find the attached minimal example to reproduce the behavior.
Precondition: Some component has been loaded in the Loader by setting its source property to an url (e.g. setSource('qrc:/OtherComponent.qml')).
When setting the source to an empty string (setSource('')), the status stays on its previous value, whatever that may be. I would expect it to be Loader.Null, because no component is currently loaded, or Loader.Error, because the source "empty string" cannot be found. The item is unloaded btw, but the status does not change.
In a second case, the loader's source is set to undefined (setSource()). According to the documentation, this shall unload the component - and it does. But the status is set to Loader.Error. I would expect it to be Loader.Null as it has been properly unloaded.