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 |
QVariant | 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
이 있습니다. 또한 서식에는 속성 열거형에 설명된 대로 다양한 속성(일부는 특정 서식 유형에만 해당)이 있습니다. 모든 속성에는 해당 속성이 있습니다.
형식 유형은 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 객체가 서식을 지정하는 텍스트 항목을 설명합니다.
Constant | 값 | 설명 |
---|---|---|
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 와 연관되어 있는지를 설명합니다.
Constant | 값 | 설명 |
---|---|---|
QTextFormat::NoObject | 0 | |
QTextFormat::ImageObject | 1 | |
QTextFormat::TableObject | 2 | |
QTextFormat::TableCellObject | 3 | |
QTextFormat::UserObject | 0x1000 | 애플리케이션별 용도로 사용할 수 있는 첫 번째 객체입니다. |
QTextObject, QTextTable, 및 QTextObject::format()도 참조하세요 .
열거형 QTextFormat::PageBreakFlag
플래그 QTextFormat::PageBreakFlags
이 열거형은 인쇄할 때 페이지 나누기가 수행되는 방식을 설명합니다. 해당 CSS 프로퍼티에 매핑됩니다.
Constant | 값 | 설명 |
---|---|---|
QTextFormat::PageBreak_Auto | 0 | 페이지 나누기는 현재 페이지의 사용 가능한 공간에 따라 자동으로 결정됩니다. |
QTextFormat::PageBreak_AlwaysBefore | 0x001 | 항상 단락/표 앞에서 페이지가 끊어집니다. |
QTextFormat::PageBreak_AlwaysAfter | 0x010 | 새 페이지는 항상 단락/표 뒤에 시작됩니다. |
PageBreakFlags 유형은 QFlags<PageBreakFlag>에 대한 typedef입니다. 페이지브레이크플래그 값의 OR 조합을 저장합니다.
QTextBlockFormat::pageBreakPolicy(), QTextFrameFormat::pageBreakPolicy() 및 PageBreakPolicy 를참조하세요 .
enum QTextFormat::Property
이 열거형은 형식이 가질 수 있는 다양한 속성을 설명합니다.
Constant | 값 | 설명 |
---|---|---|
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 | 탭 위치를 지정합니다. 탭 위치는 QList (내부적으로는 QList<QVariant>)에 저장되는 QTextOption::Tab 의 구조입니다. |
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에 추가되었습니다. |
문자 속성
Constant | 값 | 설명 |
---|---|---|
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::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 속성을 지정합니다. |
표 셀 속성
Constant | 값 |
---|---|
QTextFormat::TableCellRowSpan | 0x4810 |
QTextFormat::TableCellColumnSpan | 0x4811 |
QTextFormat::TableCellLeftPadding | 0x4814 |
QTextFormat::TableCellRightPadding | 0x4815 |
QTextFormat::TableCellTopPadding | 0x4812 |
QTextFormat::TableCellBottomPadding | 0x4813 |
QTextTableFormat::borderCollapse 활성화된 상태에서 사용하기 위한 테이블 셀 속성
Constant | 값 |
---|---|
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 |
이미지 속성
Constant | 값 | 설명 |
---|---|---|
QTextFormat::ImageName | 0x5000 | 이미지의 파일명 또는 소스입니다. |
QTextFormat::ImageTitle | 0x5001 | HTML 이미지 태그의 제목 속성 또는 마크다운 이미지 링크의 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에 추가되었습니다. |
선택 속성
Constant | 값 | 설명 |
---|---|---|
QTextFormat::FullWidthSelection | 0x06000 | 선택 영역의 문자 형식에 설정하면 텍스트의 전체 너비가 선택된 상태로 표시됩니다. |
페이지 나누기 속성
상수 | 값 | 설명 |
---|---|---|
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 유형이 아닌 경우 거짓이 대신 반환됩니다.
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
형식이 속성을 저장하지 않으면 참을 반환하고, 그렇지 않으면 거짓을 반환합니다.
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
형식이 유효하면 true
을 반환하고(즉, InvalidFormat 이 아닌 경우), 그렇지 않으면 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도 참조하세요 .
QVariant 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
을 반환합니다.
© 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.