Advertisement
Guest User

Untitled

a guest
May 6th, 2015
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Item {
  2. id: nodeContainer
  3. width: parent.width
  4. height: rect.height
  5.  
  6. property bool isExpanded: false
  7. property int childrenHeight: 0
  8.  
  9. property int dpm: Screen.pixelDensity
  10.  
  11. signal toggled(bool expanded, int newHeight)
  12.  
  13. Rectangle {
  14. id: rect
  15. width: parent.width
  16. height: 9 * dpm
  17. color: "orangered"
  18.  
  19. MouseArea {
  20. anchors.fill: parent
  21. onClicked: {
  22. isExpanded = !isExpanded
  23. nodeContainer.toggled(isExpanded, childrenHeight)
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement