Are the example images of padding and inset correct?
-
Shouldn't the padding area be between the red Background and the blue Content item? Why does it here refer to the distance directly from the outside to the content area? Is this correct?
Or is my understanding correct? Inset is the distance between a component and the outside, while padding is the distance between the Background and the Content item.
I really don't understand this picture; it confuses me.
-
@Lopher said in Are the example images of padding and inset correct?:
Shouldn't the padding area be between the red Background and the blue Content item? Why does it here refer to the distance directly from the outside to the content area? Is this correct?
Or is my understanding correct? Inset is the distance between a component and the outside, while padding is the distance between the Background and the Content item.
Is that the Control layout diagram? If not, I'm out of wild guesses.
The diagram is correct. The documentation for Control.padding appears to have been written without considering non-0 insets.
test.qml:
import QtQuick import QtQuick.Controls Window { width: 200 height: 100 visible: true Control { id: control anchors.fill: parent leftInset: 10 leftPadding: leftInset * 2 contentItem: Rectangle { color: "light blue" Text { text: "contentItem.width:" + control.contentItem.width + "\nbackground.width:" + control.background.width + "\ncontrol.width:" + control.width } } background: Rectangle { color: "red" } } }