Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
0db214e51ac36d5ce5499c52cf4054b81e910bbb
Description
New active property allows convenient syntax for conditionally loading content inside QML application. Unfortunately it doesn't work as you would expect: Loader loads it's contents even when active property is set to false. Loader source component should never be executed in the below code example, but currently it is because QSGLoader::componentComplete() always loads the sourceComponent if it has been defined.
import QtQuick 2.0 Rectangle { color: "blue" width: 100; height: 100 Loader { active: false anchors.fill: parent sourceComponent: Rectangle { color: "red" } onLoaded: console.log("Source loaded") } }