QLatin1Char Struct

The QLatin1Char class provides an 8-bit ASCII/Latin-1 character. 更多...

头: #include <QLatin1Char>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

注意: 在此结构中的所有函数均 可重入 .

公共函数

QLatin1Char (char c )
char toLatin1 () const
char16_t unicode () const
QLatin1Char operator""_L1 (char ch )

详细描述

This class is only useful to construct a QChar with 8-bit character.

另请参阅 QChar , QLatin1StringView ,和 QString .

成员函数文档编制

[explicit constexpr] QLatin1Char:: QLatin1Char ( char c )

Constructs a Latin-1 character for c . This constructor should be used when the encoding of the input character is known to be Latin-1.

[constexpr] char QLatin1Char:: toLatin1 () const

Converts a Latin-1 character to an 8-bit ASCII representation of the character.

[constexpr] char16_t QLatin1Char:: unicode () const

Converts a Latin-1 character to an 16-bit-encoded Unicode representation of the character.

相关非成员

[constexpr, since 6.4] QLatin1Char operator""_L1 ( char ch )

文字运算符创建的 QLatin1Char out of ch .

以下代码创建 QLatin1Char :

using namespace Qt::Literals::StringLiterals;
auto ch = 'a'_L1;
					

该函数在 Qt 6.4 引入。

另请参阅 Qt::Literals::StringLiterals .