Using null in QML
Unsolved
QML and Qt Quick
-
I wouldn't think so.
property var x: null property var y: undefined
Note that null is not the same as undefined.
-
@fcarney Is it even necessary in the QML world? Can I just leave it uninitialized like so:
property var X;
and tbh, I am initializing it as null but I am never running null checks when I use it...
@Circuits said in Using null in QML:
Is it even necessary in the QML world? Can I just leave it uninitialized like so:
property var X;no, it is undefined if you let it uninitialized.you can test it
property var undefinedVar Component.onCompleted: console.log(undefinedVar) // output > qml: undefined