PDA

View Full Version : When itemDelegate have specific value, change properties



updaterr
10th June 2014, 11:01
Hello
How to change properties for delegate, when item have a specific property ? I don't know which signal is good for this to use function.

Component {
id: listSendedDelegate
Rectangle {
color: "#50B7C8"
radius: 5
width: parent.width; height: 100
Column {
Text { text: datasms + " " + stan }
Text { font.bold: true;font.pixelSize: 12;text: trescsms; }

}
//this problem (if this item has a stan=="undefined" change background color for this item to green
Component.onCompleted: {
if(stan=="undefined")
color="green"
}
//this problem
}
}

anda_skoa
10th June 2014, 11:24
You don't need any signal for that, changing one property based on the value of another is normal usage for property bindings



color: stan == "undefined" ? "green" : "#50B7C8"


Cheers,
_

updaterr
10th June 2014, 11:40
ahh... so simple... i forget about that...