Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
6.2.9, dev
-
None
Description
It should be possible to assign null to a property when calling createObject:
import QtQuick import QtQuick.Controls import QtQuick.Layouts ApplicationWindow { id: window width: 800 height: 600 visible: true Component.onCompleted: { // Works // let textArea = textAreaComponent.createObject(window.contentItem, { background: redRect }) // No effect let textArea = textAreaComponent.createObject(window.contentItem, { background: null }) title = textArea.background.toString() } Rectangle { id: redRect objectName: "redRect" color: 'red' } Component { id: textAreaComponent TextArea { text: "TextArea" } } }
The expected output of this example is:
qrc:/quick/Main.qml:109: TypeError: Cannot call method 'toString' of null
Tested on different platforms with different versions of qtdeclarative:
cacb0ea963ae70f909246c1c1b639f2f78a3a003 (older) macOS - didn't work 68ad21c13073c0e4a52d0bd7b211ac175c251c2c (newest) macOS - didn't work 6f2722177be3ab74f04d0a88e8d0d72b8ee8920f (older) Kubuntu - worked 68ad21c13073c0e4a52d0bd7b211ac175c251c2c (newest) Kubuntu - worked 02c4c817fe1cfa4766c56759be99fb081382a586 (older) Windows - didn't work 68ad21c13073c0e4a52d0bd7b211ac175c251c2c (newest) Windows - didn't work