Qt3DExtras::QText2DEntity Class
class Qt3DExtras::QText2DEntityQText2DEntity permet de créer un texte en 2D dans un espace 3D. En savoir plus...
| En-tête : | #include <Qt3DExtras/QText2DEntity> |
| CMake : | find_package(Qt6 REQUIRED COMPONENTS 3dextras) target_link_libraries(mytarget PRIVATE Qt6::3dextras) |
| qmake : | QT += 3dextras |
| En QML : | Text2DEntity |
| Hérite de : | Qt3DCore::QEntity |
| Statut : | Obsolète |
Cette classe est obsolète. Nous déconseillons fortement de l'utiliser dans du nouveau code.
Propriétés
Fonctions publiques
| Qt::Alignment | alignment() const |
| QColor | color() const |
| QFont | font() const |
| float | height() const |
| void | setAlignment(Qt::Alignment alignment) |
| void | setColor(const QColor &color) |
| void | setFont(const QFont &font) |
| void | setHeight(float height) |
| void | setText(const QString &text) |
| void | setWidth(float width) |
| QString | text() const |
| float | width() const |
Signaux
| void | colorChanged(const QColor &color) |
| void | fontChanged(const QFont &font) |
| void | heightChanged(float height) |
| void | textChanged(const QString &text) |
| void | widthChanged(float width) |
Description détaillée
La classe QText2DEntity affiche le texte sous forme de triangles dans le plan XY. La géométrie sera ajustée dans le rectangle dont la largeur et la hauteur sont spécifiées. Si la géométrie obtenue est plus large que la largeur spécifiée, le reste sera affiché sur une nouvelle ligne.
L'entité peut être positionnée dans la scène en ajoutant un composant de transformation.
QText2DEntity créera une géométrie basée sur la forme des glyphes et un matériau plein utilisant la couleur spécifiée.
Documentation des propriétés
alignment : Qt::Alignment
Renvoie l'alignement de l'élément de texte affiché dans la scène Qt Quick.
L'alignement par défaut est à gauche en haut.
Fonctions d’accès :
| Qt::Alignment | alignment() const |
| void | setAlignment(Qt::Alignment alignment) |
color : QColor
Contient la couleur de l'élément de texte affiché dans la scène « Qt Quick ».
Fonctions d'accès :
| QColor | color() const |
| void | setColor(const QColor &color) |
Signal de notification :
| void | colorChanged(const QColor &color) |
font : QFont
Contient la police de caractères de l'élément de texte affiché dans la scène « Qt Quick ».
Fonctions d'accès :
| QFont | font() const |
| void | setFont(const QFont &font) |
Signal de notification :
| void | fontChanged(const QFont &font) |
height : float
Renvoie la hauteur de l’élément de texte affiché dans la scène « Qt Quick ».
Fonctions d'accès :
| float | height() const |
| void | setHeight(float height) |
Signal de notification :
| void | heightChanged(float height) |
text : QString
Contient le texte affiché dans la scène « Qt Quick ».
Fonctions d'accès :
| QString | text() const |
| void | setText(const QString &text) |
Signal de notification :
| void | textChanged(const QString &text) |
width : float
Renvoie la largeur de l'élément de texte affiché dans la scène « Qt Quick ».
Fonctions d'accès :
| float | width() const |
| void | setWidth(float width) |
Signal de notification :
| void | widthChanged(float width) |
© 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.