diff options
Diffstat (limited to 'src/quickcontrols/doc/snippets/qtquickcontrols-pageindicator-custom.qml')
-rw-r--r-- | src/quickcontrols/doc/snippets/qtquickcontrols-pageindicator-custom.qml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/quickcontrols/doc/snippets/qtquickcontrols-pageindicator-custom.qml b/src/quickcontrols/doc/snippets/qtquickcontrols-pageindicator-custom.qml new file mode 100644 index 0000000000..93c2045fc3 --- /dev/null +++ b/src/quickcontrols/doc/snippets/qtquickcontrols-pageindicator-custom.qml @@ -0,0 +1,31 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +//! [file] +import QtQuick +import QtQuick.Controls + +PageIndicator { + id: control + count: 5 + currentIndex: 2 + + delegate: Rectangle { + implicitWidth: 8 + implicitHeight: 8 + + radius: width / 2 + color: "#21be2b" + + opacity: index === control.currentIndex ? 0.95 : pressed ? 0.7 : 0.45 + + required property int index + + Behavior on opacity { + OpacityAnimator { + duration: 100 + } + } + } +} +//! [file] |