QTextFormat Class
QTextFormat 클래스는 텍스트 객체( QTextDocument)에 대한 서식 정보를 제공합니다. 더 보기...
| 헤더: | #include <QTextFormat> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
| 상속된 항목: | QTextBlockFormat, QTextCharFormat, QTextFrameFormat 및 QTextListFormat |
- 상속된 멤버를 포함한 모든 멤버 목록
- QTextFormat은 리치 텍스트 처리 API 및 암시적 공유 클래스의 일부입니다.
참고: 이 클래스의 모든 함수는 재진입 가능합니다.
공개 유형
| enum | FormatType { InvalidFormat, BlockFormat, CharFormat, ListFormat, FrameFormat, UserFormat } |
| enum | ObjectTypes { NoObject, ImageObject, TableObject, TableCellObject, UserObject } |
| enum | PageBreakFlag { PageBreak_Auto, PageBreak_AlwaysBefore, PageBreak_AlwaysAfter } |
| flags | PageBreakFlags |
| enum | Property { ObjectIndex, CssFloat, LayoutDirection, OutlinePen, ForegroundBrush, …, UserProperty } |
공개 함수
| QTextFormat() | |
| QTextFormat(int type) | |
| QTextFormat(const QTextFormat &other) | |
| ~QTextFormat() | |
| QBrush | background() const |
| bool | boolProperty(int propertyId) const |
| QBrush | brushProperty(int propertyId) const |
| void | clearBackground() |
| void | clearForeground() |
| void | clearProperty(int propertyId) |
| QColor | colorProperty(int propertyId) const |
| qreal | doubleProperty(int propertyId) const |
| QBrush | foreground() const |
| bool | hasProperty(int propertyId) const |
| int | intProperty(int propertyId) const |
| bool | isBlockFormat() const |
| bool | isCharFormat() const |
| bool | isEmpty() const |
| bool | isFrameFormat() const |
| bool | isImageFormat() const |
| bool | isListFormat() const |
| bool | isTableCellFormat() const |
| bool | isTableFormat() const |
| bool | isValid() const |
| Qt::LayoutDirection | layoutDirection() const |
| QTextLength | lengthProperty(int propertyId) const |
| QList<QTextLength> | lengthVectorProperty(int propertyId) const |
| void | merge(const QTextFormat &other) |
| int | objectIndex() const |
| int | objectType() const |
| QPen | penProperty(int propertyId) const |
| QMap<int, QVariant> | properties() const |
| QVariant | property(int propertyId) const |
| int | propertyCount() const |
| void | setBackground(const QBrush &brush) |
| void | setForeground(const QBrush &brush) |
| void | setLayoutDirection(Qt::LayoutDirection direction) |
| void | setObjectIndex(int index) |
| void | setObjectType(int type) |
| void | setProperty(int propertyId, const QList<QTextLength> &value) |
| void | setProperty(int propertyId, const QVariant &value) |
| QString | stringProperty(int propertyId) const |
| void | swap(QTextFormat &other) |
| QTextBlockFormat | toBlockFormat() const |
| QTextCharFormat | toCharFormat() const |
| QTextFrameFormat | toFrameFormat() const |
| QTextImageFormat | toImageFormat() const |
| QTextListFormat | toListFormat() const |
| QTextTableCellFormat | toTableCellFormat() const |
| QTextTableFormat | toTableFormat() const |
| int | type() const |
| operator QVariant() const | |
| bool | operator!=(const QTextFormat &other) const |
| QTextFormat & | operator=(const QTextFormat &other) |
| bool | operator==(const QTextFormat &other) const |
상세 설명
QTextFormat은 문서의 특정 부분( QTextDocument)의 서식을 설명하는 데 사용되는 일반 클래스입니다. 파생 클래스인 QTextCharFormat, QTextBlockFormat, QTextListFormat 및 QTextTableFormat 는 일반적으로 더 유용하며, 문서의 특정 부분에 적용되는 서식을 설명합니다.
각 서식에는 서식할 수 있는 텍스트 항목의 종류(예: 텍스트 블록, 목록, 표 등)를 지정하는 서식 유형( FormatType )이 있습니다. 또한 서식에는 Property 열거형에 설명된 대로 다양한 속성(일부는 특정 서식 유형에 고유함)이 있습니다. 모든 속성에는 해당 Property가 있습니다.
서식 유형은 ` type()`를 통해 지정되며, 서식은 ` isCharFormat()`, ` isBlockFormat()`, ` isListFormat()`, ` isTableFormat()`, ` isFrameFormat()`, ` isImageFormat()`를 사용하여 확인할 수 있습니다. 유형이 확인되면 ` toCharFormat()`, ` toBlockFormat()`, ` toListFormat()`, ` toTableFormat()`, ` toFrameFormat()`, ` toImageFormat()`를 사용하여 해당 유형을 가져올 수 있습니다.
포맷의 속성은 setProperty() 함수를 사용하여 설정할 수 있으며, 상황에 따라 boolProperty(), intProperty(), doubleProperty(), stringProperty()을 사용하여 가져올 수 있습니다. 포맷에서 사용되는 모든 속성 ID는 allPropertyIds()를 통해 가져올 수 있습니다. merge()을 사용하여 한 포맷을 다른 포맷에 병합할 수 있습니다.
포맷의 객체 인덱스는 setObjectIndex()를 사용하여 설정할 수 있으며, objectIndex()를 사용하여 가져올 수 있습니다. 이 메서드들은 포맷을 QTextObject 와 연관시키는 데 사용할 수 있습니다. 이는 문서 내의 목록, 프레임 및 표를 표현하는 데 사용됩니다.
‘서식 있는 텍스트 처리’항목도 참조하십시오 .
멤버 유형 문서
enum QTextFormat::FormatType
이 열거형은 ` QTextFormat ` 객체가 서식을 지정하는 텍스트 항목을 나타냅니다.
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::InvalidFormat | -1 | 기본 생성자에 의해 생성된 유효하지 않은 서식 |
QTextFormat::BlockFormat | 1 | 객체가 텍스트 블록을 서식 지정합니다. |
QTextFormat::CharFormat | 2 | 객체가 단일 문자를 서식 지정합니다 |
QTextFormat::ListFormat | 3 | 객체가 목록을 서식 처리합니다 |
QTextFormat::FrameFormat | 5 | 객체가 프레임을 서식 지정합니다 |
QTextFormat::UserFormat | 100 |
QTextCharFormat, QTextBlockFormat, QTextListFormat, QTextTableFormat 및 type()도 참조하십시오 .
enum QTextFormat::ObjectTypes
이 열거형은 이 형식이 어떤 종류의 QTextObject 와 연관되어 있는지를 설명합니다.
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::NoObject | 0 | |
QTextFormat::ImageObject | 1 | |
QTextFormat::TableObject | 2 | |
QTextFormat::TableCellObject | 3 | |
QTextFormat::UserObject | 0x1000 | 애플리케이션별 용도로 사용할 수 있는 첫 번째 객체입니다. |
QTextObject, QTextTable 및 QTextObject::format()도 참조하십시오 .
enum QTextFormat::PageBreakFlag
flags QTextFormat::PageBreakFlags
이 열거형은 인쇄 시 페이지 나누기가 어떻게 수행되는지를 설명합니다. 이는 해당 CSS 속성과 대응됩니다.
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::PageBreak_Auto | 0 | 현재 페이지의 사용 가능한 공간에 따라 페이지 나누기가 자동으로 결정됩니다. |
QTextFormat::PageBreak_AlwaysBefore | 0x001 | 항상 단락/표 바로 앞에서 페이지 나누기가 이루어집니다. |
QTextFormat::PageBreak_AlwaysAfter | 0x010 | 단락/표 뒤에서 항상 새 페이지가 시작됩니다 |
PageBreakFlags 유형은 QFlags<PageBreakFlag>에 대한 typedef입니다. 이 유형은 PageBreakFlag 값들의 OR 조합을 저장합니다.
QTextBlockFormat::pageBreakPolicy(), QTextFrameFormat::pageBreakPolicy(), PageBreakPolicy도 참조하십시오 .
enum QTextFormat::Property
이 열거형은 형식이 가질 수 있는 다양한 속성을 설명합니다.
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::ObjectIndex | 0x0 | 서식 지정된 객체의 인덱스입니다. ` objectIndex()`를 참조하십시오. |
단락 및 문자 속성
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::CssFloat | 0x0800 | 프레임이 주변 텍스트에 대해 어떻게 배치되는지 |
QTextFormat::LayoutDirection | 0x0801 | 문서 내 텍스트의 레이아웃 방향 (Qt::LayoutDirection). |
QTextFormat::OutlinePen | 0x810 | |
QTextFormat::ForegroundBrush | 0x821 | |
QTextFormat::BackgroundBrush | 0x820 | |
QTextFormat::BackgroundImageUrl | 0x823 |
단락 속성
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::BlockAlignment | 0x1010 | |
QTextFormat::BlockTopMargin | 0x1030 | |
QTextFormat::BlockBottomMargin | 0x1031 | |
QTextFormat::BlockLeftMargin | 0x1032 | |
QTextFormat::BlockRightMargin | 0x1033 | |
QTextFormat::TextIndent | 0x1034 | |
QTextFormat::TabPositions | 0x1035 | 탭 위치를 지정합니다. 탭 위치는 ` QTextOption::Tab ` 구조체이며, ` QList `(내부적으로는 ` QList<QVariant>`)에 저장됩니다. |
QTextFormat::BlockIndent | 0x1040 | |
QTextFormat::LineHeight | 0x1048 | |
QTextFormat::LineHeightType | 0x1049 | |
QTextFormat::BlockNonBreakableLines | 0x1050 | |
QTextFormat::BlockTrailingHorizontalRulerWidth | 0x1060 | 수평 눈금자 요소의 너비입니다. |
QTextFormat::HeadingLevel | 0x1070 | 제목의 수준입니다. 예를 들어, 1은 HTML H1 태그에 해당하며, 그 외의 경우 0입니다. 이 열거형 값은 Qt 5.12에서 추가되었습니다. |
QTextFormat::BlockCodeFence | 0x1091 | 마크다운 코드 블록을 둘러싼 “펜스”에 사용된 문자입니다. 코드 블록이 펜스로 둘러싸이지 않고 들여쓰기된 경우, 이 블록에는 이 속성이 없어야 합니다. 이 열거형 값은 Qt 5.14에서 추가되었습니다. |
QTextFormat::BlockQuoteLevel | 0x1080 | 이 블록의 중첩 인용 깊이: 1은 블록이 최상위 블록 인용문임을 의미합니다. 블록 인용문이 아닌 블록은 이 속성을 가져서는 안 됩니다. 이 열거형 값은 Qt 5.14에서 추가되었습니다. |
QTextFormat::BlockCodeLanguage | 0x1090 | 사전 서식 지정된 블록 또는 코드 블록에 포함된 프로그래밍 언어입니다. 코드를 포함하지 않는 블록에는 이 속성이 없어야 합니다. 이 열거형 값은 Qt 5.14에 추가되었습니다. |
QTextFormat::BlockMarker | 0x10A0 | 블록과 함께 표시될 설명( type of adornment ). 이 열거형 값은 Qt 5.14에서 추가되었습니다. |
문자 속성
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::FontFamily | 0x2000 | e{이 속성은 더 이상 사용되지 않습니다.} 대신 QTextFormat::FontFamilies를 사용하십시오. |
QTextFormat::FontFamilies | 0x1FE7 | |
QTextFormat::FontStyleName | 0x1FE8 | |
QTextFormat::FontPointSize | 0x2001 | |
QTextFormat::FontPixelSize | 0x2009 | |
QTextFormat::FontSizeAdjustment | 0x2002 | FontPointSize 또는 FontPixelSize 를 사용하여 설정된 기본 글꼴 크기에 추가될 정수 값의 조정량을 지정합니다. |
QTextFormat::FontFixedPitch | 0x2008 | |
QTextFormat::FontWeight | 0x2003 | |
QTextFormat::FontItalic | 0x2004 | |
QTextFormat::FontUnderline | 0x2005 | 이 속성은 더 이상 사용되지 않습니다. 대신 QTextFormat::TextUnderlineStyle을 사용하십시오. |
QTextFormat::FontOverline | 0x2006 | |
QTextFormat::FontStrikeOut | 0x2007 | |
QTextFormat::FontCapitalization | FirstFontProperty | 텍스트에 적용할 대소문자 변환 유형을 지정합니다. |
QTextFormat::FontLetterSpacingType | 0x1FE9 | FontLetterSpacing 속성의 의미를 지정합니다. 기본값은 QFont::PercentageSpacing 입니다. |
QTextFormat::FontLetterSpacing | 0x1FE1 | 글꼴 내 개별 문자 간의 기본 간격을 변경합니다. 값은 FontLetterSpacingType에 따라 백분율 또는 절대값으로 지정됩니다. 기본값은 100%입니다. |
QTextFormat::FontWordSpacing | 0x1FE2 | 개별 단어 간의 기본 간격을 변경합니다. 양수 값은 단어 간격을 해당 픽셀 수만큼 늘리고, 음수 값은 간격을 줄입니다. |
QTextFormat::FontStretch | 0x1FEA | QFont::Stretch 속성과 대응됩니다 |
QTextFormat::FontStyleHint | 0x1FE3 | QFont::StyleHint 속성과 대응됩니다 |
QTextFormat::FontStyleStrategy | 0x1FE4 | QFont::StyleStrategy 속성과 일치합니다 |
QTextFormat::FontKerning | 0x1FE5 | 글꼴에서 커닝이 활성화되어 있는지 여부를 지정합니다. |
QTextFormat::FontHintingPreference | 0x1FE6 | QFont::HintingPreference 열거형의 값에 따라 힌팅 사용을 제어합니다. |
QTextFormat::FontFeatures | 0x2010 | [6.11부터] 타이포그래피 기능에 정수 값을 할당합니다. 자세한 내용은 QFont::setFeature()을 참조하십시오. |
QTextFormat::FontVariableAxes | 0x2011 | [6.11부터] 가변 글꼴의 가변 축에 부동 소수점 숫자를 할당합니다. 자세한 내용은 QFont::setVariableAxis()을 참조하십시오. |
QTextFormat::TextUnderlineColor | 0x2020 | 밑줄, 위줄 및 취소선을 그릴 때 사용할 색상을 지정합니다. |
QTextFormat::TextVerticalAlignment | 0x2021 | QTextCharFormat::VerticalAlignment 열거형의 값에 따라 텍스트의 수직 정렬 유형을 지정합니다. |
QTextFormat::TextOutline | 0x2022 | 텍스트 윤곽선을 그리는 데 사용되는 QPen 를 지정합니다. |
QTextFormat::TextUnderlineStyle | 0x2023 | QTextCharFormat::UnderlineStyle 열거형의 값에 따라 텍스트 밑줄 스타일을 지정합니다. |
QTextFormat::TextToolTip | 0x2024 | 텍스트의 일부에 대해 표시할 (선택 사항인) 툴팁을 지정합니다. |
QTextFormat::TextSuperScriptBaseline | 0x2025 | 위첨자 텍스트의 기준선(높이의 %)을 지정합니다. |
QTextFormat::TextSubScriptBaseline | 0x2026 | 아래첨자 텍스트의 기준선(높이의 %)을 지정합니다. |
QTextFormat::TextBaselineOffset | 0x2027 | 텍스트의 기준선(높이의 %)을 지정합니다. 양수 값은 텍스트를 해당 %만큼 위로 이동시키고, 음수 값은 아래로 이동시킵니다. |
QTextFormat::IsAnchor | 0x2030 | |
QTextFormat::AnchorHref | 0x2031 | |
QTextFormat::AnchorName | 0x2032 | |
QTextFormat::ObjectType | 0x2f00 |
목록 속성
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::ListStyle | 0x3000 | QTextListFormat::Style 열거형의 값으로 정의되는, 목록 항목에 사용되는 스타일을 지정합니다. |
QTextFormat::ListIndent | 0x3001 | 목록에 사용되는 들여쓰기 양을 지정합니다. |
QTextFormat::ListNumberPrefix | 0x3002 | 숫자 목록에서 항목 번호 앞에 추가되는 텍스트를 정의합니다. |
QTextFormat::ListNumberSuffix | 0x3003 | 숫자 목록에서 항목 번호 뒤에 추가되는 텍스트를 정의합니다. |
QTextFormat::ListStart (since Qt 6.6) | 0x3004 | 목록의 첫 번째 값을 정의합니다. |
표 및 프레임 속성
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::FrameBorder | 0x4000 | |
QTextFormat::FrameBorderBrush | 0x4009 | |
QTextFormat::FrameBorderStyle | 0x4010 | BorderStyle 열거형을 참조하십시오. |
QTextFormat::FrameBottomMargin | 0x4006 | |
QTextFormat::FrameHeight | 0x4004 | |
QTextFormat::FrameLeftMargin | 0x4007 | |
QTextFormat::FrameMargin | 0x4001 | |
QTextFormat::FramePadding | 0x4002 | |
QTextFormat::FrameRightMargin | 0x4008 | |
QTextFormat::FrameTopMargin | 0x4005 | |
QTextFormat::FrameWidth | 0x4003 | |
QTextFormat::TableCellSpacing | 0x4102 | |
QTextFormat::TableCellPadding | 0x4103 | |
QTextFormat::TableColumns | 0x4100 | |
QTextFormat::TableColumnWidthConstraints | 0x4101 | |
QTextFormat::TableHeaderRowCount | 0x4104 | |
QTextFormat::TableBorderCollapse | 0x4105 | QTextTableFormat::borderCollapse 속성을 지정합니다. |
표 셀 속성
| 상수 | 값 |
|---|---|
QTextFormat::TableCellRowSpan | 0x4810 |
QTextFormat::TableCellColumnSpan | 0x4811 |
QTextFormat::TableCellLeftPadding | 0x4814 |
QTextFormat::TableCellRightPadding | 0x4815 |
QTextFormat::TableCellTopPadding | 0x4812 |
QTextFormat::TableCellBottomPadding | 0x4813 |
QTextTableFormat::borderCollapse 가 활성화된 상태에서 사용하도록 의도된 테이블 셀 속성
| 상수 | 값 |
|---|---|
QTextFormat::TableCellTopBorder | 0x4816 |
QTextFormat::TableCellBottomBorder | 0x4817 |
QTextFormat::TableCellLeftBorder | 0x4818 |
QTextFormat::TableCellRightBorder | 0x4819 |
QTextFormat::TableCellTopBorderStyle | 0x481a |
QTextFormat::TableCellBottomBorderStyle | 0x481b |
QTextFormat::TableCellLeftBorderStyle | 0x481c |
QTextFormat::TableCellRightBorderStyle | 0x481d |
QTextFormat::TableCellTopBorderBrush | 0x481e |
QTextFormat::TableCellBottomBorderBrush | 0x481f |
QTextFormat::TableCellLeftBorderBrush | 0x4820 |
QTextFormat::TableCellRightBorderBrush | 0x4821 |
이미지 속성
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::ImageName | 0x5000 | 이미지의 파일 이름 또는 소스. |
QTextFormat::ImageTitle | 0x5001 | HTML 이미지 태그의 title 속성, 또는 마크다운 이미지 링크에서 URL 뒤에 오는 따옴표로 묶인 문자열입니다. 이 열거형 값은 Qt 5.14에서 추가되었습니다. |
QTextFormat::ImageAltText | 0x5002 | HTML 이미지 태그의 alt 속성 또는 마크다운 이미지 링크의 이미지 설명입니다. 이 열거형 값은 Qt 5.14에서 추가되었습니다. |
QTextFormat::ImageWidth | 0x5010 | |
QTextFormat::ImageHeight | 0x5011 | |
QTextFormat::ImageQuality | 0x5014 | |
QTextFormat::ImageMaxWidth | 0x5015 | 이 열거형 값은 Qt 6.8에 추가되었습니다. |
선택 속성
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::FullWidthSelection | 0x06000 | 선택 영역의 characterFormat에 이 값을 설정하면 텍스트의 전체 너비가 선택된 상태로 표시됩니다. |
페이지 나누기 속성
| 상수 | 값 | 설명 |
|---|---|---|
QTextFormat::PageBreakPolicy | 0x7000 | 페이지 나누기 방식을 지정합니다. ` PageBreakFlag ` 열거형을 참조하십시오. |
QTextFormat::UserProperty | 0x100000 |
property() 및 setProperty()도 참조하십시오 .
멤버 함수 설명서
QTextFormat::QTextFormat()
InvalidFormat 를 사용하여 새로운 텍스트 형식을 생성합니다.
FormatType도 참조하십시오 .
[explicit] QTextFormat::QTextFormat(int type)
지정된 ` type`의 새 텍스트 형식을 생성합니다.
FormatType도 참조하십시오 .
QTextFormat::QTextFormat(const QTextFormat &other)
other 텍스트 형식과 동일한 속성을 가진 새로운 텍스트 형식을 생성합니다.
[noexcept] QTextFormat::~QTextFormat()
이 텍스트 서식을 제거합니다.
QBrush QTextFormat::background() const
문서의 배경을 채우는 데 사용된 브러시를 반환합니다.
setBackground(), clearBackground(), foreground()도 참조하십시오 .
bool QTextFormat::boolProperty(int propertyId) const
propertyId 로 지정된 속성의 값을 반환합니다. 해당 속성이 QTextFormat::Bool 유형이 아닌 경우, 대신 false가 반환됩니다.
setProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty() 및 Property도 참조하십시오 .
QBrush QTextFormat::brushProperty(int propertyId) const
propertyId 로 지정된 속성의 값을 반환합니다. 해당 속성이 QMetaType::QBrush 유형이 아닌 경우, 대신 Qt::NoBrush 가 반환됩니다.
setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty() 및 Property도 참조하십시오 .
void QTextFormat::clearBackground()
문서의 배경을 칠하는 데 사용된 브러시를 지웁니다. 기본 브러시가 사용됩니다.
background(), setBackground(), clearForeground()도 참조하십시오 .
void QTextFormat::clearForeground()
문서의 전경색을 칠하는 데 사용된 브러시를 지웁니다. 기본 브러시가 사용됩니다.
foreground(), setForeground() 및 clearBackground()도 참조하십시오 .
void QTextFormat::clearProperty(int propertyId)
다음으로 지정된 속성의 값을 지웁니다. propertyId
Property도 참조하십시오 .
QColor QTextFormat::colorProperty(int propertyId) const
propertyId 로 지정된 속성의 값을 반환합니다. 해당 속성이 QMetaType::QColor 유형이 아닌 경우, 대신 유효하지 않은 색상이 반환됩니다.
setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty() 및 Property도 참조하십시오 .
qreal QTextFormat::doubleProperty(int propertyId) const
propertyId 로 지정된 속성의 값을 반환합니다. 해당 속성이 QMetaType::Double 또는 QMetaType::Float 유형이 아닌 경우, 대신 0이 반환됩니다.
setProperty(), boolProperty(), intProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty() 및 Property도 참조하십시오 .
QBrush QTextFormat::foreground() const
텍스트, 프레임 윤곽선, 표 테두리 등 전경 세부 요소를 렌더링하는 데 사용된 브러시를 반환합니다.
setForeground(), clearForeground(), background()도 참조하십시오 .
bool QTextFormat::hasProperty(int propertyId) const
텍스트 형식에 지정된 propertyId 값을 가진 속성이 있으면 true 를 반환하고, 그렇지 않으면 false 를 반환합니다.
properties() 및 Property도 참조하십시오 .
int QTextFormat::intProperty(int propertyId) const
propertyId 로 지정된 속성의 값을 반환합니다. 해당 속성이 QTextFormat::Integer 유형이 아닌 경우, 대신 0이 반환됩니다.
setProperty(), boolProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty(), lengthVectorProperty() 및 Property도 참조하십시오 .
bool QTextFormat::isBlockFormat() const
이 텍스트 형식이 BlockFormat 인 경우 true 를 반환하고, 그렇지 않은 경우 false 를 반환합니다.
bool QTextFormat::isCharFormat() const
이 텍스트 형식이 ` CharFormat`인 경우 ` true `을 반환하고, 그렇지 않은 경우 ` false`을 반환합니다.
bool QTextFormat::isEmpty() const
포맷에 속성이 저장되어 있지 않으면 true를 반환하고, 그렇지 않으면 false를 반환합니다.
propertyCount() 및 properties()도 참조하십시오 .
bool QTextFormat::isFrameFormat() const
이 텍스트 형식이 ` FrameFormat`인 경우 ` true `을 반환하고, 그렇지 않은 경우 ` false`을 반환합니다.
bool QTextFormat::isImageFormat() const
이 텍스트 형식이 이미지 형식인 경우 ` true `을 반환하고, 그렇지 않은 경우 ` false`을 반환합니다.
bool QTextFormat::isListFormat() const
이 텍스트 형식이 ` ListFormat`인 경우 ` true `을 반환하고, 그렇지 않은 경우 ` false`을 반환합니다.
bool QTextFormat::isTableCellFormat() const
이 텍스트 형식이 ` TableCellFormat`인 경우 ` true `을 반환하고, 그렇지 않은 경우 ` false`을 반환합니다.
bool QTextFormat::isTableFormat() const
이 텍스트 형식이 ` TableFormat`인 경우 ` true `를 반환하고, 그렇지 않은 경우 ` false`를 반환합니다.
bool QTextFormat::isValid() const
형식이 유효한 경우(즉, ` InvalidFormat`가 아닌 경우) ` true `를 반환하고, 그렇지 않은 경우 ` false`를 반환합니다.
Qt::LayoutDirection QTextFormat::layoutDirection() const
문서의 레이아웃 방향을 반환합니다.
setLayoutDirection()도 참조하십시오 .
QTextLength QTextFormat::lengthProperty(int propertyId) const
propertyId 로 지정된 속성의 값을 반환합니다.
setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthVectorProperty() 및 Property도 참조하십시오 .
QList<QTextLength> QTextFormat::lengthVectorProperty(int propertyId) const
propertyId 로 지정된 속성의 값을 반환합니다. 해당 속성이 QTextFormat::LengthVector 유형이 아닌 경우, 대신 빈 목록이 반환됩니다.
setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), colorProperty(), lengthProperty() 및 Property도 참조하십시오 .
void QTextFormat::merge(const QTextFormat &other)
other 형식과 이 형식을 병합합니다. 충돌이 발생하는 경우 other 형식이 우선합니다.
int QTextFormat::objectIndex() const
포맷 객체의 인덱스를 반환하며, 포맷 객체가 유효하지 않은 경우 -1을 반환합니다.
setObjectIndex()도 참조하십시오 .
int QTextFormat::objectType() const
텍스트 형식의 객체 유형을 반환합니다.
ObjectTypes 및 setObjectType()도 참조하십시오 .
QPen QTextFormat::penProperty(int propertyId) const
propertyId 로 지정된 속성의 값을 반환합니다. 해당 속성이 QMetaType::QPen 유형이 아닌 경우, 대신 Qt::NoPen 가 반환됩니다.
setProperty(), boolProperty(), intProperty(), doubleProperty(), stringProperty(), lengthProperty(), lengthVectorProperty() 및 Property도 참조하십시오 .
QMap<int, QVariant> QTextFormat::properties() const
이 텍스트 형식의 모든 속성을 포함하는 맵을 반환합니다.
QVariant QTextFormat::property(int propertyId) const
주어진 ` propertyId`로 지정된 속성을 반환합니다.
setProperty() 및 Property도 참조하십시오 .
int QTextFormat::propertyCount() const
해당 형식에 저장된 속성의 개수를 반환합니다.
void QTextFormat::setBackground(const QBrush &brush)
문서의 배경을 채우는 데 사용할 브러시를 지정된 brush 로 설정합니다.
background(), clearBackground() 및 setForeground()도 참조하십시오 .
void QTextFormat::setForeground(const QBrush &brush)
전경 브러시를 지정된 brush 로 설정합니다. 전경 브러시는 주로 텍스트를 렌더링하는 데 사용됩니다.
foreground(), clearForeground(), setBackground()도 참조하십시오 .
void QTextFormat::setLayoutDirection(Qt::LayoutDirection direction)
문서의 레이아웃 방향을 지정된 direction 로 설정합니다.
layoutDirection()도 참조하십시오 .
void QTextFormat::setObjectIndex(int index)
포맷 객체의 객체 index 를 설정합니다.
objectIndex()도 참조하십시오 .
void QTextFormat::setObjectType(int type)
텍스트 형식의 객체 유형을 ` type`로 설정합니다.
ObjectTypes 및 objectType()도 참조하십시오 .
void QTextFormat::setProperty(int propertyId, const QList<QTextLength> &value)
propertyId 로 지정된 속성의 값을 value 로 설정합니다.
property(), lengthVectorProperty() 및 Property도 참조하십시오 .
void QTextFormat::setProperty(int propertyId, const QVariant &value)
propertyId 로 지정된 속성을 주어진 value 로 설정합니다.
Property도 참조하십시오 .
QString QTextFormat::stringProperty(int propertyId) const
propertyId 로 지정된 속성의 값을 반환합니다. 해당 속성이 QMetaType::QString 타입이 아닌 경우, 대신 빈 문자열이 반환됩니다.
setProperty(), boolProperty(), intProperty(), doubleProperty(), colorProperty(), lengthProperty(), lengthVectorProperty() 및 Property도 참조하십시오 .
void QTextFormat::swap(QTextFormat &other)
이 텍스트 형식을 other 로 바꿉니다. 이 작업은 매우 빠르며 절대 실패하지 않습니다.
QTextBlockFormat QTextFormat::toBlockFormat() const
이 형식을 블록 형식으로 반환합니다.
QTextCharFormat QTextFormat::toCharFormat() const
이 형식을 문자 형식으로 반환합니다.
QTextFrameFormat QTextFormat::toFrameFormat() const
이 형식을 프레임 형식으로 반환합니다.
QTextImageFormat QTextFormat::toImageFormat() const
이 형식을 이미지 형식으로 반환합니다.
QTextListFormat QTextFormat::toListFormat() const
이 형식을 목록 형식으로 반환합니다.
QTextTableCellFormat QTextFormat::toTableCellFormat() const
이 형식을 테이블 셀 형식으로 반환합니다.
QTextTableFormat QTextFormat::toTableFormat() const
이 형식을 표 형식으로 반환합니다.
int QTextFormat::type() const
이 형식의 유형을 반환합니다.
FormatType도 참조하십시오 .
QTextFormat::operator QVariant() const
텍스트 형식을 다음으로 반환합니다. QVariant
bool QTextFormat::operator!=(const QTextFormat &other) const
이 텍스트 형식이 other 텍스트 형식과 다를 경우 true 를 반환합니다.
QTextFormat &QTextFormat::operator=(const QTextFormat &other)
이 텍스트 형식에 ‘ other ’ 텍스트 형식을 할당하고, 이 텍스트 형식에 대한 참조를 반환합니다.
bool QTextFormat::operator==(const QTextFormat &other) const
이 텍스트 형식이 ‘ other ’ 텍스트 형식과 동일한 경우 true 를 반환합니다.
© 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.