ToolButton QML Type

ToolBar に適した外観を持つボタン ...続きを読む

Import Statement: import QtQuick.Controls
Inherits:

Button

詳細説明

ToolButton は、機能的にはButton に似ていますが、ToolBar 内でより適した外観を提供します。

ToolBar {
    RowLayout {
        anchors.fill: parent
        ToolButton {
            text: qsTr("‹")
            onClicked: stack.pop()
        }
        Label {
            text: "Title"
            elide: Label.ElideRight
            horizontalAlignment: Qt.AlignHCenter
            verticalAlignment: Qt.AlignVCenter
            Layout.fillWidth: true
        }
        ToolButton {
            text: qsTr("⋮")
            onClicked: menu.open()
        }
    }
}

ToolButton は、その API をAbstractButton から継承しています。例えば、text を設定し、アイコンを表示し、AbstractButton API を使用してclicks に反応することができます。

ToolBarToolButtonのカスタマイズ、およびボタン・コントロールも参照してください

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