qml - How to float an image right so it stays right when window is resized? -


when put image in rectangle, it's position top-left. how can anchor top-right in manner remain there upon resizing window?

import qtquick 2.0 rectangle {     id: outestrec     width: 500     height: 500     image     {         id: imglonnie         source: "http://www.lonniebest.com/image/photo/lonnieleebest.png";         //anchors.right: anchorline;         } } 

anchors { right : outestrec.right; top: outestrec.top }

edit :

explanation : attach element top, have use top anchor. doing wont enough, have specified should attached top of parent, not where. anchoring top, free move anywhere horizontally. attaching right of parent fix position right top corner.

only anchors.right : attaches right side, still free move , down

only anchors.top : attaches top , still free move left , right

both : there single possibility satisfies both these conditions together, right top corner.

read here in detail.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -