Qt Code:
  1. Item{
  2. property int type: 0
  3.  
  4. Image {
  5. id: img
  6.  
  7.  
  8. source: if(type==0) {
  9. "pics/U_basketball.png"
  10. } else if(type!=0)
  11. {
  12. "pics/U_soccerball.png"
  13. }
  14.  
  15. anchors.fill: parent
  16. }
  17. Behavior on y {
  18.  
  19. SequentialAnimation {
  20. SmoothedAnimation{ velocity: 800 }
  21.  
  22.  
  23. PropertyAction { target: img; property: "source"; value:if(type == 0)
  24. {
  25. "pics/U_basketball_blurEffect.png";
  26.  
  27. }else if(type!=0)
  28. {
  29. "pics/U_soccerBall_blurEffect.png";
  30.  
  31. }
  32.  
  33.  
  34. }
  35. }
To copy to clipboard, switch view to plain text mode 


This is code when a ball falls on a mouseclick.At the end the balls source must change .I used PropertyAction for it. The image source changes at the end but the problem is that "else if " part is not working. The two types of ball(type 0 and 1 use the same picture )
. Is this is the right way. Please help me in this .