Page2.qml 964 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import QtQuick 2.11
  2. Rectangle {
  3. id:page2
  4. width: parent.width
  5. height: parent.height
  6. color: "blue"
  7. Text {
  8. anchors.centerIn: parent
  9. text: "Page2 Test"
  10. }
  11. focus: true
  12. Keys.onPressed: {
  13. console.log("Loaded item captured: ", event.text);
  14. event.accepted = true;
  15. }
  16. /*
  17. function show(){
  18. animationShow.running = true
  19. console.log("Loaded page2 show ");
  20. }
  21. function exit(){
  22. //BreatheTestJs.exit = true
  23. animationExit.running = true
  24. //startStopButton.running = false
  25. //stopTimer.start()
  26. }
  27. //加载任务动画效果
  28. NumberAnimation {
  29. id: animationShow
  30. target: page
  31. property: "x"
  32. from: page.x
  33. to: 0
  34. duration: 500
  35. }
  36. NumberAnimation {
  37. id: animationExit
  38. target: page
  39. property: "x"
  40. from: page.x
  41. to: 1024
  42. duration: 500
  43. }
  44. */
  45. }