Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 0.59 KB | None | 0 0
  1. Item {
  2.     Item {
  3.         width:rect1.width
  4.         height: rect1.height
  5.         x: 30
  6.         y: 55
  7.        
  8.         Rectangle {
  9.             id: rect1
  10.             width: 50
  11.             height: width
  12.         }
  13.     }
  14.    
  15.    
  16.     Item {
  17.         width:rect2.width
  18.         height: rect2.height
  19.         x: 3
  20.         y: 79
  21.        
  22.         //How to get the coordinates without referring to parent's coordinates to move rect2 so that its center is in the center of rect1
  23.         Rectangle {
  24.             id: rect2
  25.             width: 43
  26.             height: width
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement