Sur cette page

Qt3DAnimation::QCallbackMapping Class

class Qt3DAnimation::QCallbackMapping

Permet d'associer les canaux du clip à l'appel d'un objet de rappel. En savoir plus...

En-tête : #include <qcallbackmapping.h>
CMake : find_package(Qt6 REQUIRED COMPONENTS 3danimation)
target_link_libraries(mytarget PRIVATE Qt6::3danimation)
qmake : QT += 3danimation
Hérite de : Qt3DAnimation::QAbstractChannelMapping
Statut : Aperçu technologique

Cette classe est en avant-première technologique et est susceptible d'être modifiée.

Propriétés

Fonctions publiques

QString channelName() const
void setCallback(int type, Qt3DAnimation::QAnimationCallback *callback, Qt3DAnimation::QAnimationCallback::Flags flags = QAnimationCallback::OnOwningThread)

Emplacements publics

void setChannelName(const QString &channelName)

Signaux

void channelNameChanged(QString channelName)

Description détaillée

Documentation des propriétés

channelName : QString

Contient le nom du canal pour le mappage de rappel.

Fonctions d'accès :

QString channelName() const
void setChannelName(const QString &channelName)

Signal de notification :

void channelNameChanged(QString channelName)

Documentation des fonctions membres

void QCallbackMapping::setCallback(int type, Qt3DAnimation::QAnimationCallback *callback, Qt3DAnimation::QAnimationCallback::Flags flags = QAnimationCallback::OnOwningThread)

Associe un objet « callback » à ce mappage de canal.

Ces mappages ne doivent pas nécessairement comporter d’objet cible ni de nom de propriété. Lorsque l’objet ` callback ` est défini, chaque modification de la valeur animée entraîne l’appel de la fonction ` valueChanged ` de la fonction de rappel, soit sur le thread `gui/main`, soit directement sur l’un des threads de travail du pool de threads. Ce comportement est contrôlé par ` flags`.

type Spécifie le type (par exemple, ` QMetaType::QVector3D`, ` QMetaType::QColor` ou ` QMetaType::Float`) de la valeur animée. Lors de l’animation des propriétés d’un nœud, il n’est pas nécessaire de le fournir séparément ; cependant, il devient important de le préciser lorsqu’il n’y a qu’un seul callback.

Remarque : un mappage peut être associé à la fois à une propriété de nœud et à une fonction de rappel. Il est toutefois important que ` type ` corresponde au type de la propriété dans ce cas. Notez également que pour les propriétés de type ` QVariant ` (par exemple, `QParameter::value`), ` type ` correspond au type de la valeur stockée dans ` QVariant`.

Remarque : le pointeur ` callback ` est censé rester valide tant que les animateurs associés sont en cours d'exécution.

© 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.