diff options
Diffstat (limited to 'examples/multimedia/video/qmlvideo/qmlvideo/SceneMove.qml')
-rw-r--r-- | examples/multimedia/video/qmlvideo/qmlvideo/SceneMove.qml | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/examples/multimedia/video/qmlvideo/qmlvideo/SceneMove.qml b/examples/multimedia/video/qmlvideo/qmlvideo/SceneMove.qml new file mode 100644 index 000000000..d1512831e --- /dev/null +++ b/examples/multimedia/video/qmlvideo/qmlvideo/SceneMove.qml @@ -0,0 +1,49 @@ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick + +Scene { + id: root + property int margin: 20 + property string contentType + + Content { + id: content + anchors.verticalCenter: parent.verticalCenter + width: parent.contentWidth + contentType: root.contentType + source: parent.source1 + volume: parent.volume + + SequentialAnimation on x { + id: animation + loops: Animation.Infinite + property int from: root.margin + property int to: 100 + property int duration: 1500 + running: false + PropertyAnimation { + from: animation.from + to: animation.to + duration: animation.duration + easing.type: Easing.InOutCubic + } + PropertyAnimation { + from: animation.to + to: animation.from + duration: animation.duration + easing.type: Easing.InOutCubic + } + } + + onVideoFramePainted: root.videoFramePainted() + } + + onWidthChanged: { + animation.to = root.width - content.width - margin + animation.start() + } + + Component.onCompleted: root.content = content +} |