在本页

TextStyle QML Type

定义控件标签的文本样式。更多

Import Statement: import Qt.labs.StyleKit

属性

详细说明

TextStyle 提供用于控制控件内文本标签外观的属性,如color,alignmentpadding ,以及某些与字体相关的属性,如bold,italicfont size

它可作为text 分组属性在每个ControlStateStyle 上使用。

注意: Qt.labs 模块中的类型不保证在未来版本中保持兼容。

另请参阅 DelegateStyle,ControlStyle,ControlStateStyle, 和FallbackStyle 参考

属性文档

alignment : Qt::Alignment

文本在可用区域内的对齐方式。

bold : bool

是否以粗体显示文本。默认值为false

另请参阅 italic

bottomPadding : real

文本周围的底部填充。如果未设置,则返回padding

另请参阅 padding,topPadding,leftPaddingrightPadding

color : color

文字的颜色。

italic : bool

是否以斜体显示文本。默认值为false

另请参阅 bold

leftPadding : real

文本周围的左填充。如果未设置,则返回padding

另请参阅 padding,rightPadding,topPaddingbottomPadding

padding : real

文本周围的统一填充。设置此项可为leftPadding,rightPadding,topPadding, 和bottomPadding 提供默认值。每一边都可以单独覆盖。

另请参阅 leftPadding,rightPadding,topPaddingbottomPadding

pointSize : real

文本字体的大小。

rightPadding : real

文本周围的右侧填充。如果未设置,则返回padding

另请参阅 padding,leftPadding,topPaddingbottomPadding

topPadding : real

文本周围的顶部填充。如果未设置,则返回padding

另请参阅 padding,bottomPadding,leftPaddingrightPadding

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