本页内容

融合风格

“融合”风格是一种以桌面为导向的风格。

Fusion 风格是一种与平台无关的风格,提供以桌面为导向的外观和体验。它采用了与 Qt Widgets 中的 Fusion 风格相同的设计语言。

Fusion 样式会根据系统设置自动在深色和浅色主题之间切换。有关如何设置自定义主题颜色的信息,请参阅“自定义”部分。

Fusion 风格浅色主题的控件图库

Fusion 样式的浅色主题。

Fusion 风格深色主题的控件图库

Fusion 样式的深色主题。

若要以 Fusion 样式运行应用程序,请参阅《Qt Quick Controls 》中的“使用样式”部分。

注意: Fusion样式 并非原生桌面样式。该样式可在任何平台上运行,且在各平台上的外观基本一致。由于标准系统调色板、可用字体以及字体渲染引擎的差异,可能会出现细微差别。

自定义

Fusion 样式使用标准系统颜色方案(Palette )来提供与桌面环境相匹配的颜色。

三种配色方案的Fusion风格控件

您可以为任何控件、popup 或application window 指定自定义调色板。显式的调色板属性会自动从父级传递给子级,并覆盖该属性的任何系统默认值。在下面的示例中,窗口和所有三个开关均显示为紫色高亮色:

import QtQuick
import QtQuick.Controls

ApplicationWindow {
    visible: true

    palette.highlight: "violet"

    Column {
        anchors.centerIn: parent

        Switch { text: qsTr("First"); checked: true }
        Switch { text: qsTr("Second"); checked: true }
        Switch { text: qsTr("Third") }
    }
}

融合风格的控件,采用自定义的紫色调色板

另请参阅:基本样式、Material 样式、通用样式

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