QTextItem Class
QTextItem 클래스는 사용자 정의 페인트 엔진에서 텍스트를 그리는 데 필요한 모든 정보를 제공합니다. 더 보기...
| 헤더: | #include <QTextItem> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
공개 유형
| enum | RenderFlag { RightToLeft, Overline, Underline, StrikeOut } |
| flags | RenderFlags |
공개 함수
| qreal | ascent() const |
| qreal | descent() const |
| QFont | font() const |
| QTextItem::RenderFlags | renderFlags() const |
| QString | text() const |
| qreal | width() const |
상세 설명
자신만의 페인트 엔진을 재구현할 때는, QTextItem을 인자 중 하나로 받는 함수인 QPaintEngine::drawTextItem()을 재구현해야 합니다.
멤버 유형 설명
enum QTextItem::RenderFlag
flags QTextItem::RenderFlags
| 상수 | 값 | 설명 |
|---|---|---|
QTextItem::RightToLeft | 0x1 | 텍스트를 오른쪽에서 왼쪽으로 렌더링합니다. |
QTextItem::Overline | 0x10 | 텍스트 위에 선을 그립니다. |
QTextItem::Underline | 0x20 | 텍스트 아래에 선을 그립니다. |
QTextItem::StrikeOut | 0x40 | 텍스트를 가로지르는 선을 그립니다. |
RenderFlags 유형은 QFlags<RenderFlag>에 대한 typedef입니다. 이 유형은 RenderFlag 값들의 OR 조합을 저장합니다.
멤버 함수 문서
qreal QTextItem::ascent() const
그려진 텍스트 조각의 ‘ ascent ’에 해당합니다.
qreal QTextItem::descent() const
그려진 텍스트 조각의 ‘ descent ’에 해당합니다.
QFont QTextItem::font() const
텍스트를 그릴 때 사용해야 할 글꼴을 반환합니다.
QTextItem::RenderFlags QTextItem::renderFlags() const
사용된 렌더링 플래그를 반환합니다.
QString QTextItem::text() const
그려져야 할 텍스트를 반환합니다.
qreal QTextItem::width() const
그려질 텍스트의 전체 너비를 지정합니다.
© 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.