本页内容

实例交换

您在组件实例中的某个图层中使用了实例交换功能。

请选择“Reset overrides ”以撤销实例交换,并修改主组件,使其无需进行交换。

如何构建不使用实例交换的组件

以下示例展示了一个未使用实例交换构建的图标按钮组件。一个包含不同图标变体的图标组件实例被嵌套在IconButton 组件中。

嵌套图标实例的属性会在组件属性面板中显示。

在不进行实例交换的情况下构建组件

当嵌套图标实例的属性在组件属性面板中显示时,从图标组件的变体中选择不同的图标就变得非常容易。

一个不进行实例交换的按钮

一个 IconButton 实例。

另请参阅 “修复转换问题”、“组件”和“变体”。

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