分隔符控件
Qt Quick Controls 提供多种分隔符供选择。
将菜单中的一组项目与相邻项目分隔开 | |
将工具栏中的一组项目与相邻项目分隔开 |
每种分隔符都有其特定的使用场景。以下各节提供了根据具体使用场景选择合适分隔符类型的指南。
MenuSeparator 控件

MenuSeparator 应用于分隔菜单中的项目(通常为MenuItem 控件)。将相关的菜单项分组,可让用户更轻松地与菜单进行交互。例如,典型的桌面用户界面可能会将Undo 和Redo 项归为一组,而将Cut 、Copy 和Paste 归为另一组。
ToolSeparator 控件

ToolSeparator 应用于将“ToolBar ”中的项目(通常是ToolButton 控件)分隔开来。它可用于水平或垂直工具栏中。
相关信息
© 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.