Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
4.7.1, 5.5.0
-
None
Description
This code works:
import QtQuick 1.0 Rectangle { width: 100; height: 100 Foo { bar: [ Item { objectName: "Item A" }, Item { objectName: "Item B" } ] } }
Foo.qml
import QtQuick 1.0 QtObject { property list<Item> bar: [ Item { objectName: "Item 1" }, Item { objectName: "Item 2" }, Item { objectName: "Item 3" } ] Component.onCompleted: { for(var i = 0; i < bar.length; i++) { print("bar: " + bar[i].objectName); } } }
But this does not:
import QtQuick 1.0 Rectangle { width: 100; height: 100 Foo { Item { objectName: "Item A" } Item { objectName: "Item B" } } }
Foo.qml
import QtQuick 1.0 QtObject { default property list<Item> bar: [ Item { objectName: "Item 1" }, Item { objectName: "Item 2" }, Item { objectName: "Item 3" } ] Component.onCompleted: { for(var i = 0; i < bar.length; i++) { print("bar: " + bar[i].objectName); } } }
Attachments
Issue Links
- is duplicated by
-
QTBUG-10822 property declarations don't accept all types
-
- Closed
-