Advertisement
artemmarchenko

Host rectangle takes width of inner centered content

Aug 26th, 2011
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import QtQuick 1.0
  2.  
  3.  
  4. Rectangle {
  5.     id: outerRect
  6.     width: childrenRect.width;
  7.     height: childrenRect.height
  8.     color: "lightblue"
  9.     Rectangle {
  10.         width: childrenRect.width
  11.         height: childrenRect.height
  12.         Row {
  13.             id: innerChild
  14.             spacing: 10
  15.             Rectangle {
  16.                 width: 100
  17.                 height: 100
  18.                 color: "red"
  19.             }
  20.             Rectangle {
  21.                 width: 100
  22.                 height: 100
  23.                 color: "green"
  24.             }
  25.             Rectangle {
  26.                 width: 100
  27.                 height: 100
  28.                 color: "blue"
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement