QTextObject Class
QTextObject 클래스는 QTextDocument 의 일부를 함께 그룹화할 수 있는 다양한 종류의 객체를 위한 기본 클래스입니다. 더 보기...
Header: | #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()도 참조하세요 .
© 2025 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.