AnchorAnimation QML Type
Anima los cambios en los valores del ancla. Más...
| Import Statement: | import QtQuick |
| Inherits: |
Propiedades
- duration : int
- easing
- easing.amplitude : real
- easing.overshoot : real
- easing.period : real
- easing.type : enumeration
- targets : list<Item>
Descripción detallada
AnchorAnimation se utiliza para animar un cambio de ancla.
En el siguiente fragmento animamos la adición de un ancla derecha a un 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" }
Cuando se utiliza una AnchorAnimation en un Transition, animará cualquier AnchorChanges que se haya producido durante el cambio de estado. Esto puede anularse estableciendo un elemento de destino específico mediante la propiedad AnchorChanges.target.
Nota: AnchorAnimation sólo puede utilizarse en Transition y junto con AnchorChange. No puede utilizarse en comportamientos y otros tipos de animaciones.
Ver también Animación y Transiciones en Qt Quick y AnchorChanges.
Documentación de Propiedades
duration : int
Esta propiedad contiene la duración de la animación, en milisegundos.
El valor por defecto es 250.
easing group
Especifica la curva de flexión utilizada para la animación.
Para especificar una curva de flexión es necesario especificar al menos el tipo. Para algunas curvas también se puede especificar la amplitud, el periodo y/o el rebasamiento. La curva por defecto es Lineal.
AnchorAnimation { easing.type: Easing.InOutQuad }
Consulte la documentación de PropertyAnimation::easing.type para obtener información sobre los diferentes tipos de curvas de flexión.
targets : list<Item> [read-only]
Los elementos a reanclar.
Si no se especifica ningún objetivo, todos los AnchorChanges serán animados por el 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.