Label QML Type
具有继承字体的样式文本标签。更多
Import Statement: | import QtQuick.Controls |
Inherits: |
属性
- background : Item
- bottomInset : real
(since QtQuick.Controls 2.5 (Qt 5.12))
- implicitBackgroundHeight : real
(since QtQuick.Controls 2.5 (Qt 5.12))
- implicitBackgroundWidth : real
(since QtQuick.Controls 2.5 (Qt 5.12))
- leftInset : real
(since QtQuick.Controls 2.5 (Qt 5.12))
- rightInset : real
(since QtQuick.Controls 2.5 (Qt 5.12))
- topInset : real
(since QtQuick.Controls 2.5 (Qt 5.12))
详细说明
Label 通过样式和font 继承扩展了Text 。默认颜色和字体与样式有关。标签还可以有一个可视化background 项。
Label { text: "Label" }
您可以使用Text 的属性,根据需要更改文本的外观:
Label { text: "Hello world" font.pixelSize: 22 font.italic: true }
另请参阅 自定义标签。
属性文档
bottomInset : real |
implicitBackgroundHeight : real |
该属性保存隐式背景高度。
其值等于background ? background.implicitHeight : 0
。
该属性在 QtQuick.Controls 2.5 (Qt 5.12) 中引入。
另请参阅 implicitBackgroundWidth 。
implicitBackgroundWidth : real |
该属性保存隐式背景宽度。
其值等于background ? background.implicitWidth : 0
。
该属性在 QtQuick.Controls 2.5 (Qt 5.12) 中引入。
另请参阅 implicitBackgroundHeight 。
leftInset : real |
rightInset : real |
topInset : real |
© 2025 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.