Padding QML Type
This item simply adds an external padding to contentItem's size. More...
Import Statement: | import org.kde.kirigami.layouts |
Since: | 6.0 |
Properties
- availableHeight : qreal
- availableWidth : qreal
- bottomPadding : qreal
- contentItem : Item
- horizontalPadding : qreal
- implicitContentHeight : qreal
- implicitContentWidth : qreal
- leftPadding : qreal
- padding : qreal
- rightPadding : qreal
- topPadding : qreal
- verticalPadding : qreal
Detailed Description
Padding item behaves similarly to Control::padding, but is more lightweight and thus efficient. Its implicit size is set to that of its contentItem's implicit size plus padding.
import QtQuick.Controls as QQC2 import org.kde.kirigami as Kirigami Kirigami.Padding { padding: Kirigami.Units.largeSpacing contentItem: QQC2.Button {} }
With this component it is possible to add external paddings as a placeholder for an item, whereas with QtQuick.Layouts you would need to manually assign or bind attached properties whenever content item changes.
import QtQuick import QtQuick.Layouts import QtQuick.Controls as QQC2 import org.kde.kirigami as Kirigami ColumnLayout { property alias contentItem: container.contentItem Kirigami.Heading { Layout.fillWidth: true Layout.margins: Kirigami.Units.largeSpacing } Kirigami.Padding { id: container Layout.fillWidth: true padding: Kirigami.Units.largeSpacing } }
Property Documentation
availableHeight : qreal |
The height available to the contentItem after deducting vertical padding from the width of the Padding.
availableWidth : qreal |
The width available to the contentItem after deducting horizontal padding from the width of the Padding.
bottomPadding : qreal |
This property holds the padding on the bottom side.
Unless explicitly set, it falls back to verticalPadding and then to padding.
contentItem : Item |
This property holds the visual content Item.
It will automatically resized taking into account all the paddings
horizontalPadding : qreal |
This property holds the horizontal padding.
Unless explicitly set, the value is equal to padding.
implicitContentHeight : qreal |
The implicitHeight of its contentItem, or 0 if not present.
implicitContentWidth : qreal |
The implicitWidth of its contentItem, or 0 if not present.
leftPadding : qreal |
This property holds the padding on the left side.
Unless explicitly set, it falls back to horizontalPadding and then to padding. This always refers to the actual left, it won't be flipped on RTL layouts.
padding : qreal |
This property holds the default padding.
Padding adds a space between each edge of this ITem and its contentItem, effectively controlling its size. To specify a padding value for a specific edge of the control, set its relevant property:
rightPadding : qreal |
This property holds the padding on the right side.
Unless explicitly set, it falls back to horizontalPadding and then to padding. This always refers to the actual right, it won't be flipped on RTL layouts.
topPadding : qreal |
the padding on the top side.
Unless explicitly set, it falls back to verticalPadding and then to padding.
verticalPadding : qreal |
This property holds the vertical padding.
Unless explicitly set, the value is equal to padding.