2022-05-13 13:12:05 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-11-16 14:39:45 +00:00
|
|
|
|
2012-07-30 09:09:23 +00:00
|
|
|
//! [1]
|
2022-08-31 07:59:05 +00:00
|
|
|
import QtQuick
|
|
|
|
import CustomGeometry
|
2012-07-30 09:09:23 +00:00
|
|
|
//! [1] //! [2]
|
2011-11-16 14:39:45 +00:00
|
|
|
Item {
|
2012-07-30 09:09:23 +00:00
|
|
|
width: 300
|
|
|
|
height: 200
|
2011-11-16 14:39:45 +00:00
|
|
|
|
2012-07-30 09:09:23 +00:00
|
|
|
BezierCurve {
|
|
|
|
id: line
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 20
|
|
|
|
//! [2] //! [3]
|
|
|
|
property real t
|
2011-11-16 14:39:45 +00:00
|
|
|
SequentialAnimation on t {
|
2012-07-30 09:09:23 +00:00
|
|
|
NumberAnimation { to: 1; duration: 2000; easing.type: Easing.InOutQuad }
|
|
|
|
NumberAnimation { to: 0; duration: 2000; easing.type: Easing.InOutQuad }
|
2011-11-16 14:39:45 +00:00
|
|
|
loops: Animation.Infinite
|
|
|
|
}
|
|
|
|
|
2012-07-30 09:09:23 +00:00
|
|
|
p2: Qt.point(t, 1 - t)
|
|
|
|
p3: Qt.point(1 - t, t)
|
2011-11-16 14:39:45 +00:00
|
|
|
}
|
2012-07-30 09:09:23 +00:00
|
|
|
//! [3] //! [4]
|
2011-11-16 14:39:45 +00:00
|
|
|
Text {
|
2012-07-30 09:09:23 +00:00
|
|
|
anchors.bottom: line.bottom
|
|
|
|
|
|
|
|
x: 20
|
|
|
|
width: parent.width - 40
|
2011-11-16 14:39:45 +00:00
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
2023-01-11 09:37:45 +00:00
|
|
|
text: qsTr("This curve is a custom scene graph item, implemented using line strips")
|
2012-07-30 09:09:23 +00:00
|
|
|
}
|
2011-11-16 14:39:45 +00:00
|
|
|
}
|
2012-07-30 09:09:23 +00:00
|
|
|
//! [4]
|