Re: [Interest] Change image.source onClicked with if statement function

2016-04-20 Thread Jérôme Godbout
Take care, image source is an url (QUrl) and the property are string. You should try to put a State here, would be nicer to control the image source and other behavior. a *'red', 'green', 'yellow', 'off'* state would be nice. You could even use the image name with the state name: *Item{ id:tra

[Interest] Change image.source onClicked with if statement function

2016-04-20 Thread Ramy Atalla via Interest
Hello I am trying to emulate a traffic light,I have four images to toggle between,I made a function to check the equality of the source image and change it on click,but it doesn't work,I think the problem in checking the equality of the source. Any ideas...ThanksRamyimport QtQuick 2.4 Item{i