Advertisement
Guest User

qt test 3

a guest
Jan 4th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import QtQuick 2.0
  2.  
  3. Rectangle
  4. {
  5. width: 1024
  6. height: 768
  7. focus: true
  8.  
  9. Repeater
  10. {
  11. id: rep;
  12. model: 1700
  13.  
  14. Rectangle
  15. {
  16. id: rectt;
  17. width: 16; height: 16;
  18. color: "black";
  19.  
  20. SequentialAnimation
  21. {
  22. running: true; loops: -1;
  23. ColorAnimation { target: rectt; property:"color"; from: "black"; to: "yellow"; duration: 1000;}
  24. ColorAnimation { target: rectt; property:"color"; from: "yellow"; to: "black"; duration: 1000;}
  25. }
  26.  
  27. Timer
  28. {
  29. interval: 16; running: true; repeat: true;
  30. onTriggered:
  31. {
  32. parent.x = Math.random()*1024;
  33. parent.y = Math.random()*768;
  34. }
  35. }
  36. }
  37.  
  38. }
  39.  
  40. Keys.onPressed: { if(event.key == Qt.Key_Escape) Qt.quit(); }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement