QAnimationController Class
class Qt3DAnimation::QAnimationControllerEine Controller-Klasse für Animationen. Mehr...
Kopfzeile: | #include <QAnimationController> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
qmake: | QT += 3danimation |
In QML: | AnimationController |
Vererbt: | QObject |
Status: | Veraltet |
Eigenschaften
|
|
Öffentliche Funktionen
QAnimationController(QObject *parent = nullptr) | |
int | activeAnimationGroup() const |
void | addAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup) |
QList<Qt3DAnimation::QAnimationGroup *> | animationGroupList() |
Qt3DCore::QEntity * | entity() const |
int | getAnimationIndex(const QString &name) const |
Qt3DAnimation::QAnimationGroup * | getGroup(int index) const |
float | position() const |
float | positionOffset() const |
float | positionScale() const |
bool | recursive() const |
void | removeAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup) |
void | setAnimationGroups(const QList<Qt3DAnimation::QAnimationGroup *> &animationGroups) |
Öffentliche Slots
void | setActiveAnimationGroup(int index) |
void | setEntity(Qt3DCore::QEntity *entity) |
void | setPosition(float position) |
void | setPositionOffset(float offset) |
void | setPositionScale(float scale) |
void | setRecursive(bool recursive) |
Signale
void | activeAnimationGroupChanged(int index) |
void | entityChanged(Qt3DCore::QEntity *entity) |
void | positionChanged(float position) |
void | positionOffsetChanged(float offset) |
void | positionScaleChanged(float scale) |
void | recursiveChanged(bool recursive) |
Detaillierte Beschreibung
Qt3DAnimation::QAnimationController Die Klasse steuert die Auswahl und Wiedergabe von Animationen. Die Klasse kann verwendet werden, um alle Animationen aus dem Qt3DCore::QEntity Baum zu finden und QAnimationGroups aus den Animationen mit dem gleichen Namen zu erstellen. Der Benutzer kann auswählen, welche Animationsgruppe gerade mit dem Animationscontroller gesteuert wird, indem er die aktive Animation einstellt. Die Animationsposition wird dann auf diese Gruppe übertragen, nachdem der angegebene Positionswert mit den Werten positionScale und positionOffset skaliert und verschoben wurde.
Hinweis: Der Animationscontroller verfügt nicht über einen internen Zeitgeber, sondern der Benutzer ist für die rechtzeitige Aktualisierung der Positionseigenschaft verantwortlich.
Dokumentation der Eigenschaft
activeAnimationGroup : int
Enthält die aktuell aktive Animationsgruppe.
Zugriffsfunktionen:
int | activeAnimationGroup() const |
void | setActiveAnimationGroup(int index) |
Benachrichtigungssignal:
void | activeAnimationGroupChanged(int index) |
entity : Qt3DCore::QEntity*
Enthält die Entität, von der die Animationen gesammelt und gruppiert werden. Wenn der Controller bereits Animationen enthält, werden diese gelöscht.
Zugriffsfunktionen:
Qt3DCore::QEntity * | entity() const |
void | setEntity(Qt3DCore::QEntity *entity) |
Benachrichtigungssignal:
void | entityChanged(Qt3DCore::QEntity *entity) |
position : float
Enthält die aktuelle Position der Animation. Wenn die Position gesetzt ist, wird sie mit positionScale/positionOffset skaliert und verschoben und an die aktive Animationsgruppe weitergegeben.
Zugriffsfunktionen:
float | position() const |
void | setPosition(float position) |
Benachrichtigungssignal:
void | positionChanged(float position) |
positionOffset : float
Enthält den Positionsoffset der Animation.
Zugriffsfunktionen:
float | positionOffset() const |
void | setPositionOffset(float offset) |
Benachrichtigungssignal:
void | positionOffsetChanged(float offset) |
positionScale : float
Enthält den Positionsmaßstab der Animation.
Zugriffsfunktionen:
float | positionScale() const |
void | setPositionScale(float scale) |
Benachrichtigungssignal:
void | positionScaleChanged(float scale) |
recursive : bool
Gibt an, ob der Entitätsbaum rekursiv durchsucht werden soll, wenn Animationen von der Entität gesammelt werden. Wenn auf true gesetzt, werden die Animationen auch in den Kind-Entitäten der Entität gesucht. Wenn auf false gesetzt, wird nur die Entität, die an den Controller übergeben wurde, durchsucht.
Zugriffsfunktionen:
bool | recursive() const |
void | setRecursive(bool recursive) |
Benachrichtigungssignal:
void | recursiveChanged(bool recursive) |
Member Function Dokumentation
QAnimationController::QAnimationController(QObject *parent = nullptr)
Konstruiert einen neuen QAnimationController mit parent.
void QAnimationController::addAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup)
Fügt die angegebene animationGroup zum Controller hinzu.
QList<Qt3DAnimation::QAnimationGroup *> QAnimationController::animationGroupList()
Gibt die Liste der Animationsgruppen zurück, die der Conroller derzeit enthält.
[invokable]
int QAnimationController::getAnimationIndex(const QString &name) const
Gibt den Index der Animation mit name zurück. Gibt -1 zurück, wenn keine AnimationGroup mit dem angegebenen Namen gefunden wird.
Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus aufgerufen werden. Siehe Q_INVOKABLE.
[invokable]
Qt3DAnimation::QAnimationGroup *QAnimationController::getGroup(int index) const
Gibt die AnimationGroup mit der angegebenen index zurück.
Hinweis: Diese Funktion kann über das Meta-Objektsystem und von QML aus aufgerufen werden. Siehe Q_INVOKABLE.
void QAnimationController::removeAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup)
Entfernt die angegebene animationGroup aus dem Controller.
void QAnimationController::setAnimationGroups(const QList<Qt3DAnimation::QAnimationGroup *> &animationGroups)
Legt die animationGroups für den Controller fest. Alte Gruppen werden gelöscht.
© 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.