Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.3.0
Description
I would expect inline components to work exactly the same as external components defined in a .qml file. However, the following code doesn't work, since the enum cannot be accessed:
#!/usr/bin/env qml import QtQuick import QtQuick.Window Window { width: 320; height: 240 visible: true component MyComponent: Rectangle { enum MyColorEnum { Red, Green } property int myColor anchors.fill: parent color: myColor === MyComponent.Green ? "green" : "red" Text { text: MyComponent.MyColorEnum.Green } } MyComponent { myColor: MyComponent.Green } }
When the inline MyComponent is replaced with an external MyComponent.qml file with the same content, it works as expected.