このページでは

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"
}

Transition 内でAnchorAnimationを使用すると、状態変更中に発生したすべての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]

再アンカーするアイテム。

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

© 2026 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.