Qt3DCore::QAbstractFunctor Class
class Qt3DCore::QAbstractFunctorQAbstractFunctor è una classe base astratta per tutti i funtori. Per saperne di più...
| Intestazione: | #include <QAbstractFunctor> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3DCore) target_link_libraries(mytarget PRIVATE Qt6::3DCore) |
| qmake: | QT += 3dcore |
| Ereditato da: | |
| Stato: | Obsoleta |
Questa classe è deprecata. Si sconsiglia vivamente di utilizzarla nel nuovo codice.
Funzioni pubbliche
| QAbstractFunctor() | |
| virtual | ~QAbstractFunctor() |
| const T * | functor_cast(const Qt3DCore::QAbstractFunctor *other) const |
| virtual qintptr | id() const = 0 |
Macro
| QT3D_FUNCTOR(Class) |
Descrizione dettagliata
QAbstractFunctor viene utilizzata come classe base per tutti i funtori e i generatori di dati nel modulo Qt3DCore.
Quando l'utente definisce un nuovo funtore o generatore, deve implementare il metodo ` QAbstractFunctor::id()`, operazione che va effettuata utilizzando la macro ` QT3D_FUNCTOR ` nella definizione della classe.
Documentazione delle funzioni membro
[constexpr noexcept default] QAbstractFunctor::QAbstractFunctor()
Crea un'istanza di ` QAbstractFunctor` con i valori predefiniti.
[virtual noexcept] QAbstractFunctor::~QAbstractFunctor()
Distruttore
template <typename T> const T *QAbstractFunctor::functor_cast(const Qt3DCore::QAbstractFunctor *other) const
Questo metodo viene utilizzato per convertire il funtore other nel tipo T se quest'ultimo è di tipo T (o di una sottoclasse); in caso contrario restituisce 0. Questo metodo funziona in modo simile a qobject_cast(), ma solo con funtori derivati da QAbstractFunctor.
Attenzione: se T non è stato dichiarato con la macro QT3D_FUNCTOR, i risultati sono indefiniti.
[pure virtual] qintptr QAbstractFunctor::id() const
Restituisce un puntatore all'ID del funtore.
Documentazione delle macro
QT3D_FUNCTOR(Class)
Questa macro assegna l'ID del funtore all'Class, che viene utilizzato da QAbstractFunctor::functor_cast per determinare se è possibile effettuare il cast.
© 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.