Unsolved How to anchor elements that they aren't in the same parent or sibling ?
-
Hi,
So I wanted to anchor an element with an another that isn't in the same parent, I know QML says me that is not possible but is there a way of doing it ?
Thanks in advance for your answer !
-
Not possible. You can anchor only to parent or sibling. If u want anchor it, change the parent & do necessary anchoring.
-
@dheerendra But I can't change the parent...
-
Then you can't anchor it. Use other layout mechanism to achieve your requirement.
-
Can you show a draft of the layout that you want to achieve ? Maybe we can figure something out of it.
-
So I want the text "ArrĂȘt 2" is anchor with the text "Identifiant user :"
-
@Arkning Sorry but there's no image, try again or put it to some publicly available image or file service and give a link.
-
@Eeli-K But I can see the picture don't know why you can see it, but anyway there is the link : https://forum.qt.io/uploads/files/1495526481427-qt_forum.png
-
None of those links work for me, I can't see the picture.
-
-
@Arkning The linked page shows only text "Not found", nothing else.
-
@Eeli-K So I don't know what to do except describing you what I want or maybe I can send you the source code compile it and see what I want ?
But anyway imagine just you have a rectangle and you have a Text under it at approximatively 2/5 of the width of the rectangle. So I want to anchor a text that is inside the rectangle with the left or right of the Text under the Rectangle. -
@Arkning Got it. So do it like this, put both texts inside the Rectangle, the Rectangle being the parent of both. Then you want one text to be under the rectangle, so use a anchor with a negative value. That should work.
Regarding the link to the image not working, I think its currently a bug on the forum, you should use a external service like https://imagebin.ca/ or something similar, and just paste the link of the image here.