QLatin1Char Struct
QLatin1Char 类提供了一个 8 位 ASCII/Latin-1 字符。更多
头文件 | #include <QLatin1Char> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
- 所有成员(包括继承成员)的列表
- QLatin1Char 是字符串数据类的一部分。
注意:该结构体中的所有函数都是可重入的。
公共函数
QLatin1Char(char c) | |
char | toLatin1() const |
char16_t | unicode() const |
相关非成员
(since 6.4) QLatin1Char | operator""_L1(char ch) |
详细说明
该类仅用于构建具有 8 位字符的QChar 。
另请参阅 QChar,QLatin1StringView, 和QString 。
成员函数文档
[explicit constexpr noexcept]
QLatin1Char::QLatin1Char(char c)
为c 构造一个 Latin-1 字符。当已知输入字符的编码为 Latin-1 时,应使用此构造函数。
[constexpr noexcept]
char QLatin1Char::toLatin1() const
将 Latin-1 字符转换为该字符的 8 位 ASCII 表示形式。
[constexpr noexcept]
char16_t QLatin1Char::unicode() const
将 Latin-1 字符转换为 16 位编码的 Unicode 字符。
相关非成员
[constexpr noexcept, since 6.4]
QLatin1Char operator""_L1(char ch)
字面运算符,从ch 创建QLatin1Char 。
下面的代码创建了一个QLatin1Char :
using namespace Qt::Literals::StringLiterals; auto ch = 'a'_L1;
此函数在 Qt 6.4 中引入。
另请参阅 Qt::Literals::StringLiterals 。
© 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.