fix 'listItem.ListView.view' [null] is not an object warning

attached property like obj.QmlType is consider as true in qml, should
check full property obj.QmlType.property instead.
This commit is contained in:
Weng Xuetian 2013-01-11 20:05:25 -05:00
parent 8e7a995797
commit 7dd6ca01ca

View File

@ -89,7 +89,7 @@ Item {
prefix: "normal" prefix: "normal"
anchors.fill: parent anchors.fill: parent
visible: listItem.ListView && listItem.ListView.view.highlight === null visible: listItem.ListView.view ? listItem.ListView.view.highlight === null : false
opacity: itemMouse.containsMouse && !itemMouse.pressed ? 0.5 : 1 opacity: itemMouse.containsMouse && !itemMouse.pressed ? 0.5 : 1
Component.onCompleted: { Component.onCompleted: {
prefix = (listItem.sectionDelegate ? "section" : (listItem.checked ? "pressed" : "normal")) prefix = (listItem.sectionDelegate ? "section" : (listItem.checked ? "pressed" : "normal"))