property alias causes crash in 5.9.1
Unsolved
QML and Qt Quick
-
When calling createObject() on the component with property alias, crash happens.
The code snipet is as follows.
[main.qml]
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")Item { id: root anchors.fill: parent Foo { id: foo } Timer { id: timer running: true repeat: true interval: 1000 onTriggered: { foo.createObject(root, {"foo": 0.5, "foo2": 2, "foo3": true}) } } }
}
[Foo.qml]
Component {
Item {
property alias foo: bar.opacity
property alias foo2: bar.scale
property alias foo3: bar.visibleid: foo x: 100 y: 100 width: 100 height: 100 Rectangle { id: bar anchors.fill: parent color: "green" } }
}
-
@Surka Hi. Property alias and the Item id has the same name foo - it can't be the same. I also don't think that Rectangle has property scale.
-
@m-kuncevicius Yes, that's my typo. But it is irrelavant to the crash. The issue here is Qt reporting its internal assertion. btw, scale is property of Item.