diff options
Diffstat (limited to 'examples/qt3d/bigmodel-qml')
-rw-r--r-- | examples/qt3d/bigmodel-qml/main.qml | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/examples/qt3d/bigmodel-qml/main.qml b/examples/qt3d/bigmodel-qml/main.qml index 704d17872..2d5cdf536 100644 --- a/examples/qt3d/bigmodel-qml/main.qml +++ b/examples/qt3d/bigmodel-qml/main.qml @@ -59,22 +59,35 @@ Entity { upVector: Qt.vector3d( 0.0, 1.0, 0.0 ) } + QQ2.ListModel { + id: entityModel + QQ2.ListElement { emptyRole: 0 } + } + NodeInstantiator { id: collection - property int count: 64 + property int _count: 0 property real spacing: 5 property int cols: 8 property int _rows: count / cols - model: count + model: entityModel delegate: MyEntity { id: myEntity property real _lightness: 0.2 + 0.7 / collection._rows * Math.floor(index / collection.cols) property real _hue: (index % collection.cols) / collection.cols - x: collection.spacing * (index % collection.cols - 0.5 * (collection.cols - 1)) z: collection.spacing * (Math.floor(index / collection.cols) - 0.5 * collection._rows) diffuse: Qt.hsla( _hue, 0.5, _lightness, 1.0 ) } } + + QQ2.Timer { + interval: 1000 + repeat: true + running: true + onTriggered: { + entityModel.append({}); + } + } } |