QTextItem Class
La clase QTextItem proporciona toda la información necesaria para dibujar texto en un motor de dibujo personalizado. Más información...
| Encabezado: | #include <QTextItem> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
Tipos públicos
| enum | RenderFlag { RightToLeft, Overline, Underline, StrikeOut } |
| flags | RenderFlags |
Funciones públicas
| qreal | ascent() const |
| qreal | descent() const |
| QFont | font() const |
| QTextItem::RenderFlags | renderFlags() const |
| QString | text() const |
| qreal | width() const |
Descripción detallada
Al reimplementar su propio motor de pintura, debe reimplementar la función ` QPaintEngine::drawTextItem()`, que toma un `QTextItem` como uno de sus argumentos.
Documentación de tipos de miembros
enum QTextItem::RenderFlag
flags QTextItem::RenderFlags
| Constante | Valor | Descripción |
|---|---|---|
QTextItem::RightToLeft | 0x1 | Muestra el texto de derecha a izquierda. |
QTextItem::Overline | 0x10 | Dibuja una línea encima del texto. |
QTextItem::Underline | 0x20 | Dibuja una línea debajo del texto. |
QTextItem::StrikeOut | 0x40 | Dibuja una línea que atraviesa el texto. |
El tipo RenderFlags es un typedef para QFlags<RenderFlag>. Almacena una combinación OR de valores de RenderFlag.
Documentación de las funciones miembro
qreal QTextItem::ascent() const
Corresponde a la « ascent » del fragmento de texto que se muestra.
qreal QTextItem::descent() const
Corresponde a la « descent » del fragmento de texto que se muestra.
QFont QTextItem::font() const
Devuelve la fuente que se debe utilizar para dibujar el texto.
QTextItem::RenderFlags QTextItem::renderFlags() const
Devuelve los indicadores de representación utilizados.
QString QTextItem::text() const
Devuelve el texto que se debe dibujar.
qreal QTextItem::width() const
Especifica la anchura total del texto que se va a dibujar.
© 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.