Advertisement
Guest User

Untitled

a guest
Oct 17th, 2011
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 KB | None | 0 0
  1. import QtQuick 1.1
  2. import com.nokia.meego 1.0
  3.  
  4. Page {
  5. //id: scanPage
  6. anchors.fill: parent
  7.  
  8. Rectangle {
  9. id: scanwrapper
  10. anchors.fill: parent
  11. color: "gray"
  12.  
  13. Item {
  14. id: videoWidget
  15. // this will be where the video is shown
  16. height: 100 //480
  17. width: 100// 480
  18. //anchors { top: parent.top; left: parent.left; }
  19.  
  20. Rectangle {
  21. anchors.fill: videoWidget
  22. color: "yellow"
  23. }
  24. }
  25.  
  26.  
  27. Rectangle {
  28. id: scanButtonRow
  29. width: childrenRect.width
  30. height: childrenRect.height
  31.  
  32. onWidthChanged: {
  33. console.log("scanButtonRow is now:" , width);
  34. }
  35.  
  36. color: "blue"
  37. //height: Math.max(scanButton.height, openButton.height)
  38. //anchors { top: videoWidget.bottom; left: parent.left; }
  39. //anchors.left: scanwrapper.left
  40.  
  41. Button {
  42. id: scanButton
  43. text: "Scan"
  44. anchors {
  45. top: parent.top
  46. left: parent.left
  47. }
  48.  
  49. onWidthChanged: {
  50. console.log("scanButton is now:" , width);
  51. }
  52. //width: Math.round(parent.width/2)
  53. onClicked: { }
  54. }
  55.  
  56. Rectangle {
  57. id: spacer
  58. height: 10
  59. anchors {
  60. top: scanButton.bottom;
  61. left: parent.left
  62. }
  63. }
  64.  
  65. Button {
  66. id: openButton
  67. text: "Open image"
  68. anchors {
  69. top: spacer.bottom;
  70. left: parent.left
  71. }
  72. //width: Math.round(parent.width/2)
  73. onClicked: { }
  74. onWidthChanged: {
  75. console.log("openButton is now:" , width);
  76. }
  77. }
  78.  
  79. }
  80. }
  81.  
  82.  
  83.  
  84. states: [
  85.  
  86. State {
  87. name: "Landscape"
  88. when: !inPortrait
  89. PropertyChanges {
  90. target: videoWidget
  91. height: 100 //450 // need to avoid the toolbar
  92. width: 100 // 450
  93. }
  94.  
  95. AnchorChanges {
  96. target: videoWidget
  97. anchors.left: scanwrapper.left
  98. anchors.top: scanwrapper.top
  99. //anchors.verticalCenter: scanwrapper.verticalCenter
  100. //anchors.horizontalCenter: None
  101. }
  102.  
  103. // --------------------------------
  104.  
  105. // PropertyChanges {
  106. // target: scanButtonRow
  107. // width: Math.min(250, 480 - videoWidget.width)
  108. // }
  109.  
  110. AnchorChanges {
  111. target: scanButtonRow
  112. anchors.left: videoWidget.right
  113. //anchors.right: scanwrapper.right
  114. //anchors.horizontalCenter: None
  115. anchors.verticalCenter: scanwrapper.verticalCenter
  116. //anchors.horizontalCenter: videoWidget.width + (scanwrapper.width - videoWidget.width)/2
  117. }
  118. },
  119.  
  120. State {
  121. name: "Portrait"
  122. when: inPortrait
  123.  
  124. PropertyChanges {
  125. target: videoWidget
  126. height: 100 //480
  127. width: 100 //480 // full screen width
  128. }
  129.  
  130. AnchorChanges {
  131. target: videoWidget
  132. anchors.top: scanwrapper.top
  133. anchors.horizontalCenter: scanwrapper.horizontalCenter
  134. //anchors.right: scanwrapper.right
  135. //anchors.bottom: scanButtonRow.top
  136. }
  137. // --------------------------------
  138.  
  139. PropertyChanges {
  140. target: scanButtonRow
  141. width: 250
  142. }
  143. AnchorChanges {
  144. target: scanButtonRow
  145. anchors.top: videoWidget.bottom
  146. //anchors.left: scanwrapper.left
  147. anchors.horizontalCenter: scanwrapper.horizontalCenter
  148. //anchors.verticalCenter: (scanwrapper.height - videoWidget.height)/2
  149.  
  150. }
  151.  
  152. }
  153.  
  154. ]
  155.  
  156.  
  157. }
  158.  
  159.  
  160.  
  161.  
  162.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement