QTextObject Class
QTextObject 클래스는 QTextDocument 의 일부를 묶어줄 수 있는 다양한 종류의 객체를 위한 기본 클래스입니다. 더 보기...
| 헤더: | #include <QTextObject> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
| 상속: | QObject |
| 상속받는 항목: |
- 상속받은 멤버를 포함한 모든 멤버 목록
- QTextObject는 리치 텍스트 처리 API의 일부입니다.
참고: 이 클래스의 모든 함수는 재진입 가능합니다.
공개 함수
| QTextDocument * | document() const |
| QTextFormat | format() const |
| int | formatIndex() const |
| int | objectIndex() const |
보호된 함수
| QTextObject(QTextDocument *document) | |
| virtual | ~QTextObject() |
| void | setFormat(const QTextFormat &format) |
상세 설명
일반적인 텍스트 객체 그룹으로는 목록(QTextList), 프레임(QTextFrame) 및 표(QTextTable)가 있습니다. 텍스트 객체에는 format() 및 document()가 연관되어 있습니다.
텍스트 객체에는 기본적으로 두 가지 종류가 있습니다. 하나는 블록(블록 서식)과 함께 사용되는 것이고, 다른 하나는 문자(문자 서식)와 함께 사용되는 것입니다. 첫 번째 종류는 QTextBlockGroup 에서 파생되며, 두 번째 종류는 QTextFrame 에서 파생됩니다.
이 클래스를 직접 사용할 일은 거의 없습니다. 사용자 정의 텍스트 객체를 생성할 때는 텍스트 객체를 생성하는 팩토리 메서드 역할을 하는 QTextDocument::createObject()을 재구현해야 합니다.
QTextDocument도 참조하십시오 .
멤버 함수 문서
[explicit protected] QTextObject::QTextObject(QTextDocument *document)
지정된 ` document`에 대한 새로운 `QTextObject`를 생성합니다.
경고: 이 함수는 절대 직접 호출해서는 안 되며, 오직 ` QTextDocument::createObject()`를 통해서만 호출해야 합니다.
[virtual noexcept protected] QTextObject::~QTextObject()
텍스트 객체를 삭제합니다.
경고: 텍스트 객체는 문서가 소유하고 있으므로, 절대로 직접 삭제해서는 안 됩니다.
QTextDocument *QTextObject::document() const
이 객체가 속한 문서를 반환합니다.
format()도 참조하십시오 .
QTextFormat QTextObject::format() const
텍스트 객체의 형식을 반환합니다.
setFormat() 및 document()도 참조하십시오 .
int QTextObject::formatIndex() const
문서의 내부 형식 목록에서 해당 객체의 형식 인덱스를 반환합니다.
QTextDocument::allFormats()도 참조하십시오 .
int QTextObject::objectIndex() const
이 객체의 인덱스를 반환합니다. 이 메서드는 ` QTextFormat::setObjectIndex()`와 함께 사용할 수 있습니다.
[protected] void QTextObject::setFormat(const QTextFormat &format)
텍스트 객체의 format 를 설정합니다.
format()도 참조하십시오 .
© 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.