From 8b100bed5237b1ec864f059d7fb04b94fd874f49 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 23 Nov 2022 16:50:43 +0800 Subject: Doc: remove "2" from Qt Quick Controls files Work on this was already started for the documentation in 1abdfe5d5a052f2298b7bf657513dfa7e0c66a56. The CMake target (docs_QuickControls2) probably can't be renamed until we rename the library, which won't happen until Qt 7. Task-number: QTBUG-95413 Change-Id: Ied20805a91286436606577c3de39671a447f27dd Reviewed-by: Paul Wicking Reviewed-by: Qt CI Bot --- .../snippets/qtquickcontrols-toolbutton-custom.qml | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/quickcontrols/doc/snippets/qtquickcontrols-toolbutton-custom.qml (limited to 'src/quickcontrols/doc/snippets/qtquickcontrols-toolbutton-custom.qml') diff --git a/src/quickcontrols/doc/snippets/qtquickcontrols-toolbutton-custom.qml b/src/quickcontrols/doc/snippets/qtquickcontrols-toolbutton-custom.qml new file mode 100644 index 0000000000..6ec46b0adf --- /dev/null +++ b/src/quickcontrols/doc/snippets/qtquickcontrols-toolbutton-custom.qml @@ -0,0 +1,31 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +//! [file] +import QtQuick +import QtQuick.Controls + +ToolButton { + id: control + text: qsTr("ToolButton") + width: 120 + + contentItem: Text { + text: control.text + font: control.font + opacity: enabled ? 1.0 : 0.3 + color: control.down ? "#17a81a" : "#21be2b" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + } + + background: Rectangle { + implicitWidth: 40 + implicitHeight: 40 + color: Qt.darker("#33333333", control.enabled && (control.checked || control.highlighted) ? 1.5 : 1.0) + opacity: enabled ? 1 : 0.3 + visible: control.down || (control.enabled && (control.checked || control.highlighted)) + } +} +//! [file] -- cgit v1.2.3