Qml Tips
= Qml tips // See https://hubpress.gitbooks.io/hubpress-knowledgebase/content/ for information about the parameters. // :hp-image: /covers/cover.png // :published_at: 2019-01-31 :hp-tags: Qt, Qml // :hp-alt-title: My English Title
In an item (A) which handle the position of his sons (B, BB, BBB) (e.g.: a RowLayout) you don’t have to put anchors.fill: parent to one of the sons, if you do this the son’s position management will be broken.
In this example the rectangle B is used to do a background which is wrong, the right solution is to put this rectangle at the root, as a parent of the RowLayout.
[source,javascript]
RowLayout { id: A Rectangle { id: B anchors.fill: parent // don’t do this ! color: “red” }
Rectangle {
id: BB
}
Rectangle {
id: BBB
} }