ToolSeparator QML Type

将工具栏中的一组项目与相邻项目分开。更多

Import Statement: import QtQuick.Controls
Inherits:

Control

属性

详细说明

ToolSeparator 用于用直线分隔工具栏中的各组项目,从而在视觉上将它们区分开来。通过将orientation 属性分别设置为Qt.VerticalQt.Horizontal ,可将其用于水平或垂直工具栏。

ToolBar {
    RowLayout {
        anchors.fill: parent

        ToolButton {
            text: qsTr("Action 1")
        }
        ToolButton {
            text: qsTr("Action 2")
        }

        ToolSeparator {}

        ToolButton {
            text: qsTr("Action 3")
        }
        ToolButton {
            text: qsTr("Action 4")
        }

        ToolSeparator {}

        ToolButton {
            text: qsTr("Action 5")
        }
        ToolButton {
            text: qsTr("Action 6")
        }

        Item {
            Layout.fillWidth: true
        }
    }
}

另请参阅 自定义工具分隔符分隔符控件

属性文档

horizontal : bool [read-only]

该属性用于确定orientation 是否等于Qt.Horizontal

它对于自定义工具分隔符非常有用。

另请参阅 orientationvertical


orientation : enumeration

该属性表示工具分隔符的方向。

可能的值:

常量说明
Qt.Horizontal垂直工具栏中使用水平分隔线。
Qt.Vertical垂直分隔线用于水平工具栏。(默认值)

vertical : bool [read-only]

该属性表示orientation 是否等于Qt.Vertical

该属性对于自定义工具分隔符非常有用。

另请参阅 orientationhorizontal


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