Label QML Type

Styled text label with inherited font. More...

Import Statement: import QtQuick.Controls 2.5
Since: Qt 5.7
Inherits:

Text

Properties

Detailed Description

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

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
}

See also Customizing Label.

Property Documentation

background : Item

This property holds the background item.

Note: 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.

See also Customizing Label.


bottomInset : real

This property holds the bottom inset for the background.

This property was introduced in QtQuick.Controls 2.5 (Qt 5.12).

See also Control Layout and topInset.


[read-only] implicitBackgroundHeight : real

This property holds the implicit background height.

The value is equal to background ? background.implicitHeight : 0.

This property was introduced in QtQuick.Controls 2.5 (Qt 5.12).

See also implicitBackgroundWidth.


[read-only] implicitBackgroundWidth : real

This property holds the implicit background width.

The value is equal to background ? background.implicitWidth : 0.

This property was introduced in QtQuick.Controls 2.5 (Qt 5.12).

See also implicitBackgroundHeight.


leftInset : real

This property holds the left inset for the background.

This property was introduced in QtQuick.Controls 2.5 (Qt 5.12).

See also Control Layout and rightInset.


palette : palette

This property holds the palette currently set for the label.

This property was introduced in QtQuick.Controls 2.3 (Qt 5.10).

See also Control::palette.


rightInset : real

This property holds the right inset for the background.

This property was introduced in QtQuick.Controls 2.5 (Qt 5.12).

See also Control Layout and leftInset.


topInset : real

This property holds the top inset for the background.

This property was introduced in QtQuick.Controls 2.5 (Qt 5.12).

See also Control Layout and bottomInset.


© 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.