PathInterpolator QML Type
Spécifie comment animer manuellement le long d'un chemin. Plus d'informations...
| Import Statement: | import QtQuick |
Propriétés
Description détaillée
PathInterpolator fournit les informations x, y, et angle pour un progress particulier le long d'un chemin.
Dans l'exemple suivant, nous animons un rectangle vert le long d'un chemin de Bézier.
import QtQuick Rectangle { width: 400 height: 400 PathInterpolator { id: motionPath path: Path { startX: 0; startY: 0 PathCubic { x: 350; y: 350 control1X: 350; control1Y: 0 control2X: 0; control2Y: 350 } } NumberAnimation on progress { from: 0; to: 1; duration: 2000 } } Rectangle { width: 50; height: 50 color: "green" //bind our attributes to follow the path as progress changes x: motionPath.x y: motionPath.y rotation: motionPath.angle } }
Documentation sur les propriétés
Ces propriétés indiquent la position de la trajectoire à progress.
angle : real |
Cette propriété contient l'angle de la tangente du chemin à progress.
Les angles sont indiqués dans le sens des aiguilles d'une montre, avec zéro degré à la position 3 heures.
path : Path |
Cette propriété contient le chemin à interpoler.
Pour plus d'informations sur la définition d'un chemin, voir la documentation de Path.
progress : real |
Cette propriété indique la progression actuelle le long du chemin.
L'utilisation typique de PathInterpolator consiste à définir la progression (souvent via NumberAnimation) et à lire les valeurs correspondantes pour x, y et angle (souvent via des liens vers ces valeurs).
La progression est comprise entre 0,0 et 1,0.
© 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.