blob: ed0e0d10f0d2c874b53ae13fab3aa40ad3c59f08 [file] [log] [blame]
import QtQuick 2.0
Item {
property bool success: false
Component {
id: internal
Item {
}
}
property bool expectNull: null
function setExpectNull(b) {
success = false;
expectNull = b;
}
property variant obj: null
onObjChanged: success = (expectNull ? obj == null : obj != null)
Component.onCompleted: {
setExpectNull(false)
obj = internal.createObject(null, {})
if (!success) return
// Replace with a different object
setExpectNull(false)
obj = internal.createObject(null, {})
}
function destroyObject() {
setExpectNull(true)
obj.destroy();
}
}