macOS 风格

macOS 风格是一种在 macOS 上看起来原生的风格。更多

导入声明:导入 QtQuick.Controls.macOS
Qt 6.0

macOS 风格是一种在 macOS 上看起来原生的风格。控件在运行时使用本地框架绘制,因此仅适用于在 macOS 上运行的应用程序。

注意: 请注意,为了更好地与平台上的本地应用程序融合,该样式的外观会随 Qt 版本的更新而变化。

macOS 风格的浅色主题。

macOS 风格的深色主题

要使用 macOS 风格运行应用程序,请参阅 Qt Quick Controls 中的 "使用风格"。

当前状态

macOS 风格正在开发中,某些控件尚不支持。这些控件是BusyIndicator,DelayButton,PageIndicator,RangeSlider,Switch,TabBarTumbler 。这些控件将转回使用Fusion 风格

自定义

macOS 风格的目标是使控件的外观和感觉尽可能与 UIKit 中的本地控件相似。该样式将遵循系统偏好设置中全局配置的主题和颜色,而不会在此基础上提供单独的自定义 API。

注意: macOS 风格不适合自定义。主要原因是它有时会将内容和背景都绘制到一个背景项上,这与自定义内容项搭配起来就不好看了。此外,它还倾向于使用与其他样式不同的 padding 和 inset 值。建议将自定义控件建立在所有平台都可用的单一样式之上,例如基本样式融合样式想象样式材料样式通用样式。这样做可以保证无论使用哪种样式运行应用程序,控件的外观都是一样的。要了解如何使用不同的样式,请参阅 Qt Quick Controls 中的 "使用样式"。或者,你也可以创建自己的样式

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