QTextLength Class
QTextLength 클래스는 QTextDocument 에서 사용되는 다양한 길이를 캡슐화합니다. 더 보기...
| 헤더: | #include <QTextLength> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
- 상속된 멤버를 포함한 모든 멤버 목록
- QTextLength는 리치 텍스트 처리 API의 일부입니다.
참고: 이 클래스의 모든 함수는 재진입 가능합니다.
공개 유형
| enum | Type { VariableLength, FixedLength, PercentageLength } |
공개 함수
| QTextLength() | |
| QTextLength(QTextLength::Type type, qreal value) | |
| qreal | rawValue() const |
| QTextLength::Type | type() const |
| qreal | value(qreal maximumLength) const |
| operator QVariant() const | |
| bool | operator!=(const QTextLength &other) const |
| bool | operator==(const QTextLength &other) const |
상세 설명
텍스트 문서에서 요소의 길이에 대한 값을 지정할 때, 해당 길이가 예상한 대로 사용될 수 있도록 다른 정보를 함께 제공해야 하는 경우가 종종 있습니다. 예를 들어, 테이블 너비를 지정할 때, 그 값은 고정된 픽셀 수를 나타낼 수도 있고 백분율 값일 수도 있습니다. 이 정보는 값의 의미와 사용 방식을 모두 변경합니다.
일반적으로 이 클래스는 테이블 너비를 지정하는 데 사용됩니다. 테이블 너비는 고정된 픽셀 수, 포함된 프레임 너비의 백분율, 또는 필요한 공간만 차지하도록 하는 가변 너비로 지정할 수 있습니다.
QTextTable도 참조하십시오 .
멤버 유형 설명서
enum QTextLength::Type
이 열거형은 길이 객체가 가질 수 있는 다양한 유형을 설명합니다.
| 상수 | 값 | 설명 |
|---|---|---|
QTextLength::VariableLength | 0 | 객체의 너비는 가변적입니다 |
QTextLength::FixedLength | 1 | 객체의 너비가 고정되어 있습니다 |
QTextLength::PercentageLength | 2 | 객체의 너비는 최대 너비의 백분율로 표시됩니다 |
type()도 참조하십시오 .
멤버 함수 설명서
QTextLength::QTextLength()
가변 길이를 나타내는 새로운 길이 객체를 생성합니다.
[explicit] QTextLength::QTextLength(QTextLength::Type type, qreal value)
지정된 ` type ` 및 ` value`을 사용하여 새로운 길이 객체를 생성합니다.
qreal QTextLength::rawValue() const
길이의 유형에 특정한 제약 조건 값을 반환합니다. 길이가 ` QTextLength::PercentageLength `인 경우, 원시 값은 0에서 100 사이의 백분율로 표시됩니다. 길이가 ` QTextLength::FixedLength `인 경우, 해당 고정 값이 반환됩니다. 가변 길이의 경우 0이 반환됩니다.
QTextLength::Type QTextLength::type() const
이 length 객체의 유형을 반환합니다.
QTextLength::Type도 참조하십시오 .
qreal QTextLength::value(qreal maximumLength) const
길이 객체의 유형과 지정된 maximumLength 에 따라 제한된 유효 길이를 반환합니다.
type()도 참조하십시오 .
QTextLength::operator QVariant() const
텍스트 길이를 QVariant
bool QTextLength::operator!=(const QTextLength &other) const
이 텍스트의 길이가 other 의 텍스트 길이와 다를 경우, ` true `를 반환합니다.
bool QTextLength::operator==(const QTextLength &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.