[Interest] Unexplained offset in QML

Alan Alpert 416365416c at gmail.com
Fri Jan 10 23:15:31 CET 2014


On Thu, Jan 9, 2014 at 7:28 AM, Jason H <scorp1us at yahoo.com> wrote:
> Thanks Alan. Actually, A this the case. However I don't understand why it
> matters?
>
> The "missing code" is just the Animal.qml, that only nests the elements
> accordingly for layering/grouping:
> Item {
>  Item { id: head
>    Item { id: earL}
>    Item { id: earR}
>    Item { id: face}
> }
> }
> Item { id: tail}
> }
>

My reading of Animal.qml suggested that it was nested more like below:
Item {
  Item {
   width: childrenRect.width
   height: childrenRect.height
   anchors.centerIn: parent
    Item { id: head
     Item { id: earL}
     Item { id: earR}
     Item { id: face}
   }
  }
 }
 Item { id: tail}
}

In that case, the second item is going to end up offset from the root
0,0 point of the Animal{} depending on the size of the internal items.

--
Alan Alpert



More information about the Interest mailing list