本页内容

StyleKit 控件示例

演示如何通过 Qt Widgets 。

StyleKit 控件示例,展示了按钮、滑块和设置面板

本示例演示了如何使用StyleKit为 Qt Widgets 应用程序设置样式。它展示了如何通过QStyleKitStyle 将QML定义的样式应用到标准的Qt Widgets 控件上,以及如何在运行时在不同样式和主题之间切换。

该示例包含三种样式:

  • 经典(Classic)——一种基于渐变的样式,包含浅色、深色、高对比度和绿色等多种主题。
  • Flat——一种受Material Design启发的扁平化风格,提供浅色和深色主题。
  • 霓虹(Neon)——一种受赛博朋克风格启发的深色样式,带有霓虹色的点缀。

本示例演示了如何:

运行示例

您可以从以下位置运行示例:

示例项目 @ code.qt.io

另请参阅 Qt Labs StyleKit以及StyleKit Quick Controls 示例。

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