Skip to content

Qt QML Type Label

Stephen Quan edited this page Feb 1, 2023 · 1 revision

Style text label with inherited font.

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

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

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

import QtQuick
import QtQuick.Controls
Page {
    palette.windowText: "navy"
    font.pixelSize: 22
    font.italic: true
    Label {
        text: "Label"
    }
}

You can Try it Online!