I have a property of type Component
.
import QtQuick 2.6
Item {
id: root
property Component sourceComponent
/* ........ */
Loader {
anchors.fill: parent
id: myLoader
}
SequentialAnimation {
id: hideLoader
NumberAnimation {
target: root
property: "y"
duration: 1000; from: 0; to: -root.height
}
onStopped: root.sourceComponent = undefined; //<-- Error: Cannot assign [undefined] to QQmlComponent*
}
}
Whenever I want to set it to undefined
it raises an error. How can I set it to undefined
?
UPDATE
As you can see in my sample code, I want to assign sourceComponent
of the loader
after finishing the animation. So I need property to be normal not alias
.