QML如何检查是否为空?

时间:2016-10-03 08:26:41

标签: qml

if(typeof(element) !== "undefined" && !element ){ // I tried this, but not work
    if(element.objectName === "right"){ // Get error in this line
     //....          
    }
}

由于此错误TypeError: Cannot read property 'objectName' of null ,我需要检查元素是否为空。那么qml中可以使用isNull这样的函数吗?

0 个答案:

没有答案
相关问题