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::StringLiterals;
auto ch = 'a'_L1;该函数在 Qt 6.4 中引入。
另请参阅 Qt::Literals::StringLiterals 。
© 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.