Qt5.2

Studying StackView but have no idea how to use it.

Qt Code:
  1. import QtQuick 2.2
  2. import QtQuick.Controls 1.1
  3.  
  4. Rectangle {
  5. id: root
  6.  
  7. width: 360
  8. height: 360
  9.  
  10. Column{
  11.  
  12. Button{
  13. width: root.width
  14. height: root.height / 10
  15.  
  16. onClicked: {
  17. stackView.push({item:Rectangle, properties: {width: root.width, height: root.height}})
  18. }
  19. }
  20.  
  21. StackView {
  22. id: stackView
  23. delegate: StackViewDelegate {
  24. function transitionFinished(properties)
  25. {
  26. properties.exitItem.opacity = 1
  27. }
  28.  
  29. property Component pushTransition: StackViewTransition {
  30. PropertyAnimation {
  31. target: enterItem
  32. property: "opacity"
  33. from: 0
  34. to: 1
  35. }
  36. PropertyAnimation {
  37. target: exitItem
  38. property: "opacity"
  39. from: 1
  40. to: 0
  41. }
  42. }
  43. }
  44. }
  45. }
  46. }
To copy to clipboard, switch view to plain text mode