OpacityAnimator QML Type
Der OpacityAnimator-Typ animiert die Deckkraft eines Objekts. Mehr...
Import Statement: | import QtQuick |
Inherits: |
Detaillierte Beschreibung
Animator Typen unterscheiden sich von normalen Animationstypen. Bei Verwendung eines Animators kann die Animation im Render-Thread ausgeführt werden und der Eigenschaftswert springt zum Ende, wenn die Animation abgeschlossen ist.
Der Wert von Item::opacity wird aktualisiert, nachdem die Animation beendet ist.
Das folgende Snippet zeigt, wie ein OpacityAnimator zusammen mit einem Rectangle-Element verwendet werden kann.
Rectangle { id: opacityBox width: 50 height: 50 color: "lightsteelblue" OpacityAnimator { target: opacityBox; from: 0; to: 1; duration: 1000 running: true } }
Es ist auch möglich, das Schlüsselwort on
zu verwenden, um den OpacityAnimator direkt an eine Item-Instanz zu binden.
Rectangle { width: 50 height: 50 color: "lightsteelblue" OpacityAnimator on opacity{ from: 0; to: 1; duration: 1000 } }
© 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.