AnchorAnimation QML Type

アンカー値の変化をアニメーション化する。もっと見る...

Import Statement: import QtQuick
Inherits:

Animation

プロパティ

詳細説明

AnchorAnimationは、アンカーの変更をアニメーション化するために使用します。

以下のスニペットでは、Rectangle に右アンカーが追加される様子をアニメートしています:

import QtQuick

Item {
    id: container
    width: 200; height: 200

    Rectangle {
        id: myRect
        width: 100; height: 100
        color: "red"
    }

    states: State {
        name: "reanchored"
        AnchorChanges { target: myRect; anchors.right: container.right }
    }

    transitions: Transition {
        // smoothly reanchor myRect and move into new position
        AnchorAnimation { duration: 1000 }
    }

    Component.onCompleted: container.state = "reanchored"
}

AnchorAnimation がTransition で使用されると、状態変化中に発生したAnchorChanges をアニメーション化します。これは、AnchorChanges.target プロパティを使用して特定のターゲット項目を設定することでオーバーライドできます。

注意: AnchorAnimationは、Transition 、AnchorChangeと組み合わせてのみ使用できます。ビヘイビアや他のタイプのアニメーションでは使用できません。

Qt QuickおよびAnchorChangesのアニメーションとトランジションも参照してください

プロパティの説明

duration : int

このプロパティは、アニメーションの継続時間をミリ秒単位で保持します。

デフォルト値は250です。


easing group

easing.amplitude : real

easing.overshoot : real

easing.period : real

easing.type : enumeration

アニメーションに使用するイージングカーブを指定します。

イージングカーブを指定するには、少なくともタイプを指定する必要があります。カーブによっては、振幅、周期、オーバーシュートも指定できます。デフォルトのイージングカーブは Linear です。

AnchorAnimation { easing.type: Easing.InOutQuad }

イージングカーブの種類については、PropertyAnimation::easing.type のドキュメントを参照してください。


targets : list<Item> [read-only]

リアンカーする項目。

ターゲットが指定されていない場合、すべてのAnchorChangesAnchorAnimation によってアニメーションされます。


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.