Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. import QtQuick 2.1
  2.  
  3. Rectangle {
  4. color: "blue"
  5. height: childrenRect.height
  6. //height: 300
  7. width: 560
  8.  
  9. Item {
  10. id: header
  11. anchors { top: parent.top; left: parent.left; right: parent.right }
  12. height: 60
  13. //height: childrenRect.height + 2 * 16
  14. Text {
  15. font.pixelSize: 24
  16. text: "Title"
  17. anchors.horizontalCenter: parent.horizontalCenter
  18. anchors.verticalCenter: parent.verticalCenter
  19. }
  20. }
  21. Rectangle {
  22. color: "green"
  23. anchors { top: header.bottom; bottom: footer.top;
  24. left: parent.left; right: parent.right }
  25. //height: childrenRect.height + 2 * 32
  26. height: 50
  27. Text {
  28. font.pixelSize: 16
  29. color: "white"
  30. horizontalAlignment: Text.AlignHCenter
  31. text: "some text"
  32. anchors { left: parent.left; right: parent.right;
  33. verticalCenter: parent.verticalCenter }
  34. }
  35. }
  36. Rectangle {
  37. id: footer
  38. anchors {
  39. bottom: parent.bottom;
  40. left: parent.left; right: parent.right
  41. }
  42. color: "red"
  43. height: 50
  44. //height: childrenRect.height + 2 * 16
  45. Text {
  46. font.pixelSize: 12
  47. text: "footer"
  48. anchors.horizontalCenter: parent.horizontalCenter
  49. anchors.verticalCenter: parent.verticalCenter
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement