Tag Struct
struct QFont::TagQFont::Tag 유형은 고급 글꼴 기능에 액세스할 수 있습니다. 더 보기...
이 구조체는 Qt 6.7에 도입되었습니다.
공용 함수
Tag() | |
Tag(const char (&)[N] str) | |
bool | isValid() const |
QByteArray | toString() const |
quint32 | value() const |
정적 공용 멤버
std::optional<QFont::Tag> | fromString(QAnyStringView view) |
std::optional<QFont::Tag> | fromValue(quint32 value) |
관련 비회원
Qt::strong_ordering | compareThreeWay(const QFont::Tag &lhs, const QFont::Tag &rhs) |
bool | comparesEqual(const QFont::Tag &lhs, const QFont::Tag &rhs) |
size_t | qHash(QFont::Tag key, size_t seed = 0) |
상세 설명
QFont 텍스트 모양을 만들 때 고급 기능에 대한 액세스를 제공합니다. 기능은 4자 문자열 또는 32비트 정수 값으로 표현할 수 있는 태그로 정의됩니다. 이 유형은 이러한 태그를 유형 안전 방식으로 나타냅니다. 태그는 4자, 8비트 문자열 리터럴 또는 해당 32비트 정수 값으로 구성할 수 있습니다. 더 짧거나 긴 문자열 리터럴을 사용하면 컴파일 타임 오류가 발생합니다.
QFont font; // Correct font.setFeature("frac"); // Wrong - won't compile font.setFeature("fraction"); // Wrong - will produce runtime warning and fail font.setFeature(u"fraction"_s);
명명된 생성자를 사용하면 32비트 정수 또는 문자열 값으로 태그를 만들 수 있으며 입력이 유효하지 않은 경우 std::nullopt
을 반환합니다.
QFont::setFeature() 및 QFont::featureTags()도 참조하세요 .
멤버 함수 문서
[constexpr noexcept]
Tag::Tag()
기본 생성자, 잘못된 태그를 생성합니다.
[constexpr noexcept]
template <size_t N> Tag::Tag(const char (&)[N] str)
문자열 리터럴( str)로 태그를 생성합니다. 리터럴은 정확히 4자 길이여야 합니다.
font.setFeature("frac", 1);
fromString() 및 fromValue()도 참조하세요 .
[static noexcept]
std::optional<QFont::Tag> Tag::fromString(QAnyStringView view)
view 에 있는 문자열로 구성된 태그를 반환합니다. 문자열의 길이는 정확히 4자여야 합니다.
입력이 4자가 아니거나 생성된 태그가 유효하지 않은 경우 std::nullopt
을 반환합니다.
isValid() 및 fromValue()도 참조하세요 .
[static constexpr noexcept]
std::optional<QFont::Tag> Tag::fromValue(quint32 value)
value 에서 생성된 태그를 반환하거나 생성된 태그가 유효하지 않은 경우 std::nullopt
을 반환합니다.
isValid()도 참조하세요 .
[constexpr noexcept]
bool Tag::isValid() const
태그가 유효한지 여부를 반환합니다. 태그의 값이 0이 아닌 경우 태그가 유효합니다.
value(), fromValue() 및 fromString()도 참조하세요 .
QByteArray Tag::toString() const
이 태그의 문자열 표현을 바이트 배열로 반환합니다.
fromString()도 참조하세요 .
[constexpr noexcept]
quint32 Tag::value() const
이 태그의 숫자 값을 반환합니다.
관련 비회원
[constexpr noexcept]
Qt::strong_ordering compareThreeWay(const QFont::Tag &lhs, const QFont::Tag &rhs)
[constexpr noexcept]
bool comparesEqual(const QFont::Tag &lhs, const QFont::Tag &rhs)
lhs 와 rhs 을 비교하여 동일성 및 순서를 확인하세요.
[constexpr noexcept]
size_t qHash(QFont::Tag key, size_t seed = 0)
seed 을 사용하여 key 에 대한 해시값을 반환합니다.
© 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.