PropertyAction QML Type
애니메이션 진행 중 발생하는 즉각적인 속성 변경 사항을 지정합니다. 더 보기...
| Import Statement: | import QtQuick |
| Inherits: |
속성
- exclude : list<QtObject>
- properties : string
- property : string
- target : QtObject
- targets : list<QtObject>
- value : var
상세 설명
PropertyAction은 애니메이션 도중 즉시 속성을 변경하도록 지정하는 데 사용됩니다. 이 속성 변경은 애니메이션 처리되지 않습니다.
애니메이션 진행 중에 애니메이션이 적용되지 않는 속성 값을 설정하는 데 유용합니다.
예를 들어, 다음은 이미지의 ` opacity ` 속성을 ` .5`로 설정하고, 이미지의 너비를 애니메이션 처리한 후, ` opacity `를 다시 ` 1`로 설정하는 ` SequentialAnimation `입니다:
SequentialAnimation {
PropertyAction { target: img; property: "opacity"; value: .5 }
NumberAnimation { target: img; property: "width"; to: 300; duration: 1000 }
PropertyAction { target: img; property: "opacity"; value: 1 }
}PropertyAction은 또한 Transition 도중 속성 변경이 발생해야 하는 정확한 시점을 설정하는 데에도 유용합니다. 예를 들어, PropertyChanges 이 State 에서 특정 transformOrigin 을 중심으로 항목을 회전시키는 데 사용되었다면, 다음과 같이 구현될 수 있습니다:
Item {
width: 400; height: 400
Rectangle {
id: rect
width: 200; height: 100
color: "red"
states: State {
name: "rotated"
PropertyChanges { target: rect; rotation: 180; transformOrigin: Item.BottomRight }
}
transitions: Transition {
RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
}
MouseArea {
anchors.fill: parent
onClicked: rect.state = "rotated"
}
}
}그러나 이 코드의 경우, State 은 전환이 끝날 때의 값을 정의하는 것으로 간주되므로 transformOrigin 은 애니메이션이 끝난 후에야 설정됩니다. 애니메이션은 기본 transformOrigin 을 기준으로 회전하다가, 갑자기 Item.BottomRight 으로 점프하게 됩니다. 이를 수정하려면 RotationAnimation 이 시작되기 전에 PropertyAction을 삽입하십시오:
transitions: Transition {
SequentialAnimation {
PropertyAction { target: rect; property: "transformOrigin" }
RotationAnimation { duration: 1000; direction: RotationAnimation.Counterclockwise }
}
}이렇게 하면 transformOrigin 속성이 즉시 Transition 의 종료 상태에서 정의된 값(즉, PropertyAction 객체에 정의된 값)으로 설정되어, 회전 애니메이션이 올바른 변환 원점을 기준으로 시작하게 됩니다.
Qt Quick 의 ‘애니메이션 및 전환 ’ 및 Qt Qml.
속성 문서
exclude : list<QtObject> [read-only]
이 속성은 이 작업의 영향을 받아서는 안 되는 객체들을 포함합니다.
targets도 참조하십시오 .
이러한 속성은 이 작업의 영향을 받는 항목과 해당 항목을 구성하는 속성을 결정합니다.
다양한 상황에서 이러한 속성이 어떻게 해석되는지에 대한 자세한 내용은 corresponding PropertyAnimation 문서를 참조하십시오.
exclude도 참조하십시오 .
value : var
이 속성은 해당 속성에 설정될 값을 포함합니다.
PropertyAction 가 Transition 또는 Behavior 내에서 정의된 경우, 이 값은 기본적으로 Transition 의 종료 상태에 정의된 값이나, Behavior 를 트리거한 속성 변경의 값으로 설정됩니다.
© 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.