Label QML Type

Styled text label with inherited font. 更多...

import 语句: import QtQuick.Controls 2.5
Since: Qt 5.7
继承: Text

特性

详细描述

Label extends Text with styling and font inheritance. The default colors and font are style specific. Label can also have a visual background 项。

Label {
    text: "Label"
}
					

You can use the properties of Text to change the appearance of the text as desired:

Label {
    text: "Hello world"
    font.pixelSize: 22
    font.italic: true
}
					

另请参阅 Customizing Label .

特性文档编制

background : Item

此特性保持背景项。

注意: If the background item has no explicit size specified, it automatically follows the control's size. In most cases, there is no need to specify width or height for a background item.

另请参阅 Customizing Label .

bottomInset : real

This property holds the bottom inset for the background.

该特性在 QtQuick.Controls 2.5 (Qt 5.12) 引入。

另请参阅 Control Layout and topInset .

[read-only] implicitBackgroundHeight : real

This property holds the implicit background height.

值等于 background ? background.implicitHeight : 0 .

该特性在 QtQuick.Controls 2.5 (Qt 5.12) 引入。

另请参阅 implicitBackgroundWidth .

[read-only] implicitBackgroundWidth : real

This property holds the implicit background width.

值等于 background ? background.implicitWidth : 0 .

该特性在 QtQuick.Controls 2.5 (Qt 5.12) 引入。

另请参阅 implicitBackgroundHeight .

leftInset : real

This property holds the left inset for the background.

该特性在 QtQuick.Controls 2.5 (Qt 5.12) 引入。

另请参阅 Control Layout and rightInset .

palette : palette

This property holds the palette currently set for the label.

该特性在 QtQuick.Controls 2.3 (Qt 5.10) 引入。

另请参阅 Control::palette .

rightInset : real

This property holds the right inset for the background.

该特性在 QtQuick.Controls 2.5 (Qt 5.12) 引入。

另请参阅 Control Layout and leftInset .

topInset : real

This property holds the top inset for the background.

该特性在 QtQuick.Controls 2.5 (Qt 5.12) 引入。

另请参阅 Control Layout and bottomInset .