Details
-
Bug
-
Resolution: Cannot Reproduce
-
Not Evaluated
-
None
-
5.3.2
-
None
-
Windows 7
Description
I have the following component:
import QtQuick 2.2 Rectangle { id: root; default property alias contents: contentFrame.children; color: "#05f"; width: 100; height: 100; Rectangle { id: contentFrame; anchors { fill: parent; leftMargin: 10; topMargin: 10; rightMargin: 10; bottomMargin: 10; } color: "#888"; } }
The above component is saved as Test1.qml in a resource file qml.qrc. Now I create another component Test2.qml that uses Test1:
import QtQuick 2.2 Test1 { id: root; Rectangle { id: contentFrame; anchors { fill: parent; // Note that this is NOT root, but Test1's default item! leftMargin: 10; topMargin: 10; rightMargin: 10; bottomMargin: 10; } color: "#0a0"; } /* Component // CRASH if you uncomment this! { id: separator; Rectangle { height: 1; color: "#fab"; } } */ }
If you add the definition of some component inside a component whose default property has been changed, the app would immediately crash! Please either implement this feature or make qml emit an error message instead of crashing!