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 --- ...tquickcontrols-scrollindicator-non-attached.qml | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/quickcontrols/doc/snippets/qtquickcontrols-scrollindicator-non-attached.qml (limited to 'src/quickcontrols/doc/snippets/qtquickcontrols-scrollindicator-non-attached.qml') diff --git a/src/quickcontrols/doc/snippets/qtquickcontrols-scrollindicator-non-attached.qml b/src/quickcontrols/doc/snippets/qtquickcontrols-scrollindicator-non-attached.qml new file mode 100644 index 0000000000..063c771f1b --- /dev/null +++ b/src/quickcontrols/doc/snippets/qtquickcontrols-scrollindicator-non-attached.qml @@ -0,0 +1,60 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +import QtQuick +import QtQuick.Controls + +Item { + width: 200 + height: 200 + +//! [1] +Rectangle { + id: frame + clip: true + width: 160 + height: 160 + border.color: "black" + anchors.centerIn: parent + + Text { + id: content + text: "ABC" + font.pixelSize: 169 + + MouseArea { + id: mouseArea + drag.target: content + drag.minimumX: frame.width - width + drag.minimumY: frame.height - height + drag.maximumX: 0 + drag.maximumY: 0 + anchors.fill: content + } + } + + ScrollIndicator { + id: verticalIndicator + active: mouseArea.pressed + orientation: Qt.Vertical + size: frame.height / content.height + position: -content.y / content.height + anchors { top: parent.top; right: parent.right; bottom: parent.bottom } + } + + ScrollIndicator { + id: horizontalIndicator + active: mouseArea.pressed + orientation: Qt.Horizontal + size: frame.width / content.width + position: -content.x / content.width + anchors { left: parent.left; right: parent.right; bottom: parent.bottom } + } +} +//! [1] + +Component.onCompleted: { + horizontalIndicator.active = true; + verticalIndicator.active = true; +} +} -- cgit v1.2.3