Qt5 vs Qt6 assigning empty string variable QML
Solved
QML and Qt Quick
-
Hello all,
I have just moved from Qt5 to Qt6, so I have ported QMAKE to CMAKE,
made lots of adjustments in the c++ files as well as QML files to fulfill qt6 requirements...and I am stuck at the probably most basic stuff I could find :)
in Qt5 i use:
property string taskType: null
which was fine, no error or warnings...
but when i compile this in Qt6 I have the warning:
Warning: qrc:/xxxx.qml:17:31: Invalid property assignment: string expected - Assigning null to incompatible properties in QML is deprecated. This will become a compile error in future versions of Qt.
so, how do i change the string to null value?
then how do i test if the variable is null? -
property string taskType: "" // Test: if (taskType.length === 0) { // something }