SystemPalette QML Type
提供对 Qt 调色板的访问。更多
Import Statement: | import QtQuick |
属性
- accent : color
(since 6.7)
- alternateBase : color
- base : color
- button : color
- buttonText : color
- colorGroup : enumeration
- dark : color
- highlight : color
- highlightedText : color
- light : color
- mid : color
- midlight : color
- placeholderText : color
(since 6.2)
- shadow : color
- text : color
- window : color
- windowText : color
详细说明
SystemPalette 类型提供了对 Qt 应用程序调色板的访问。它提供了用于应用程序窗口、按钮和其他功能的标准颜色信息。这些颜色分为三个颜色组:active
、inactive
和disabled
。有关颜色组和 SystemPalette 所提供属性的详细信息,请参阅QPalette 文档。
系统调色板可用于为项目着色,以提供更原生的外观和感觉。
下面的示例从Active
颜色组中创建了一个调色板,并用它为窗口和文本项目着色:
import QtQuick Rectangle { SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } width: 640; height: 480 color: myPalette.window Text { anchors.fill: parent text: "Hello!"; color: myPalette.windowText } }
另请参阅 QPalette 。
属性文档
accent : color |
alternateBase : color |
当前颜色组的备用基色。
另请参阅 QPalette::ColorRole 。
base : color |
当前颜色组的基色。
另请参阅 QPalette::ColorRole 。
button : color |
当前颜色组的按钮颜色。
另请参阅 QPalette::ColorRole 。
buttonText : color |
当前颜色组的按钮文本前景色。
另请参阅 QPalette::ColorRole 。
colorGroup : enumeration |
调色板的颜色组。可以是
常量 | 说明 |
---|---|
SystemPalette.Active | (默认值)QPalette::Active |
SystemPalette.Inactive | QPalette::Inactive |
SystemPalette.Disabled | QPalette::Disabled |
另请参阅 QPalette::ColorGroup 。
dark : color |
当前颜色组的深色。
另请参阅 QPalette::ColorRole 。
highlight : color |
当前颜色组的高亮颜色。
另请参阅 QPalette::ColorRole 。
highlightedText : color |
当前颜色组的高亮文本颜色。
另请参阅 QPalette::ColorRole 。
light : color |
当前颜色组的浅色。
另请参阅 QPalette::ColorRole 。
mid : color |
当前颜色组的中间色。
另请参阅 QPalette::ColorRole 。
midlight : color |
当前颜色组的中间浅色。
另请参阅 QPalette::ColorRole 。
placeholderText : color |
shadow : color |
当前颜色组的阴影颜色。
另请参阅 QPalette::ColorRole 。
text : color |
当前颜色组的文本颜色。
另请参阅 QPalette::ColorRole 。
window : color |
当前颜色组的窗口(一般背景)颜色。
另请参阅 QPalette::ColorRole 。
windowText : color |
当前颜色组的窗口文本(一般前景)颜色。
另请参阅 QPalette::ColorRole 。
© 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.