QTextItem Class
La clase QTextItem proporciona toda la información necesaria para dibujar texto en un motor de pintura personalizado. Más...
| Cabecera: | #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
Cuando reimplementas tu propio motor de pintura, debes reimplementar QPaintEngine::drawTextItem(), una función 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 | Renderiza el texto de derecha a izquierda. |
QTextItem::Overline | 0x10 | Pinta una línea sobre el texto. |
QTextItem::Underline | 0x20 | Pinta una línea debajo del texto. |
QTextItem::StrikeOut | 0x40 | Pintar una línea a través del texto. |
El tipo RenderFlags es un typedef para QFlags<RenderFlag>. Almacena una combinación OR de valores RenderFlag.
Documentación de las funciones miembro
qreal QTextItem::ascent() const
Corresponde a la dirección ascent del texto que se dibuja.
qreal QTextItem::descent() const
Corresponde a la dirección descent del texto que se dibuja.
QFont QTextItem::font() const
Devuelve la fuente que debe utilizarse para dibujar el texto.
QTextItem::RenderFlags QTextItem::renderFlags() const
Devuelve las banderas de renderizado utilizadas.
QString QTextItem::text() const
Devuelve el texto que debe dibujarse.
qreal QTextItem::width() const
Especifica el ancho total del texto 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.