diff options
Diffstat (limited to 'src/quickcontrols/doc/snippets/qtquickcontrols-toolbar.qml')
-rw-r--r-- | src/quickcontrols/doc/snippets/qtquickcontrols-toolbar.qml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/quickcontrols/doc/snippets/qtquickcontrols-toolbar.qml b/src/quickcontrols/doc/snippets/qtquickcontrols-toolbar.qml new file mode 100644 index 0000000000..64ec4d5431 --- /dev/null +++ b/src/quickcontrols/doc/snippets/qtquickcontrols-toolbar.qml @@ -0,0 +1,39 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls + +Item { + id: root + width: children[0].implicitWidth * 2 + height: children[0].implicitHeight + Binding { + target: root.children[0] + property: "width" + value: root.width + } +//! [1] +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() + } + } +} +//! [1] +} |