On this page

TextStyle QML Type

Defines the text style for a control's label. More...

Import Statement: import Qt.labs.StyleKit
Status: Technology preview

This type is in technology preview and is subject to change.

Properties

Detailed Description

TextStyle provides properties for controlling the appearance of text labels within a control, such as color, alignment and padding, and certain font-related properties such as bold, italic, and font size.

It is available as the text grouped property on every ControlStateStyle.

Note: Types in Qt.labs modules are not guaranteed to remain compatible in future versions.

See also DelegateStyle, ControlStyle, ControlStateStyle, and FallbackStyle Reference.

Property Documentation

alignment : Qt::Alignment

The alignment of the text within its available area.

bold : bool

Whether the text should be rendered in bold. The default value is false.

See also italic.

bottomPadding : real

The bottom padding around the text. If not set, falls back to padding.

See also padding, topPadding, leftPadding, and rightPadding.

color : color

The color of the text.

italic : bool

Whether the text should be rendered in italic. The default value is false.

See also bold.

leftPadding : real

The left padding around the text. If not set, falls back to padding.

See also padding, rightPadding, topPadding, and bottomPadding.

padding : real

The uniform padding around the text. Setting this provides a default value for leftPadding, rightPadding, topPadding, and bottomPadding. Each side can be overridden individually.

See also leftPadding, rightPadding, topPadding, and bottomPadding.

pointSize : real

The point size of the text font.

rightPadding : real

The right padding around the text. If not set, falls back to padding.

See also padding, leftPadding, topPadding, and bottomPadding.

topPadding : real

The top padding around the text. If not set, falls back to padding.

See also padding, bottomPadding, leftPadding, and rightPadding.

© 2026 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.