I am using anchors with the elements inside of Layout to place the elements from center at their respective places, but I am facing warnings (I am aware if we use anchors with Layouts it will throw warnings), but I want to find out a way to eliminate those warnings.
RowLayout {
id: rowFirst
spacing: 5
anchors.centerIn: parent
Label {
id: rgeValue
text: "0"
}
Label {
id: erUnit
anchors.centerIn: parent
anchors.horizontalCenterOffset: rgeValue.width / 2 + 5
anchors.verticalCenterOffset: rgeValue.height / 2 - rgeValueUnit.height
text: "V"
}
}
As per the design perspective I shouldn't use the margins and paddings with layout.
You can get rid of the warnings by wrapping your items into another item as a container. Still, the layout is in charge or placing your wrapper items into its cells.
As mentioned from @StephenQuan it would help to get a better impression what you want to achieve. For me it seams that you want to use Layouts in a strange way.