用例 - 样式和主题支持

用 QML 创建样式包括创建一个可视化类型,并将其绑定到一个属性或直接为一个属性赋值。对于包含Qt Quick'delegate' 的类型,可视化类型会附加到delegate属性。

访问系统调色板

SystemPalette 类型提供系统调色板信息。QML 应用程序可以使用这些信息来设置可视化类型的外观,以匹配本地的外观和感觉。此外,在桌面平台上,当改变状态时(例如,当应用程序失去键盘焦点时),会使用不同的调色板。

在使用控件时,已经使用了系统颜色。

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