QChar 类

QChar 类提供 16 位 Unicode 字符。 更多...

头: #include <QChar>
qmake: QT += core

注意: 此类的所有函数 可重入 .

公共类型

enum Category { Mark_NonSpacing, Mark_SpacingCombining, Mark_Enclosing, Number_DecimalDigit, Number_Letter, …, Symbol_Other }
enum Decomposition { NoDecomposition, Canonical, Circle, Compat, Final, …, Wide }
enum Direction { DirAL, DirAN, DirB, DirBN, DirCS, …, DirWS }
enum JoiningType { Joining_None, Joining_Causing, Joining_Dual, Joining_Right, Joining_Left, Joining_Transparent }
enum Script { Script_Unknown, Script_Inherited, Script_Common, Script_Adlam, Script_Ahom, …, Script_ZanabazarSquare }
enum SpecialCharacter { Null, Tabulation, LineFeed, FormFeed, CarriageReturn, …, LastValidCodePoint }
enum UnicodeVersion { Unicode_1_1, Unicode_2_0, Unicode_2_1_2, Unicode_3_0, Unicode_3_1, …, Unicode_Unassigned }

公共函数

QChar (uchar ch )
QChar (char ch )
QChar (wchar_t ch )
QChar (char16_t ch )
QChar (QLatin1Char ch )
QChar (QChar::SpecialCharacter ch )
QChar (int code )
QChar (uint code )
QChar (short code )
QChar (uchar cell , uchar row )
QChar (ushort code )
QChar ()
QChar::Category category () const
uchar cell () const
unsigned char combiningClass () const
QString decomposition () const
QChar::Decomposition decompositionTag () const
int digitValue () const
QChar::Direction direction () const
bool hasMirrored () const
bool isDigit () const
bool isHighSurrogate () const
bool isLetter () const
bool isLetterOrNumber () const
bool isLowSurrogate () const
bool isLower () const
bool isMark () const
bool isNonCharacter () const
bool isNull () const
bool isNumber () const
bool isPrint () const
bool isPunct () const
bool isSpace () const
bool isSurrogate () const
bool isSymbol () const
bool isTitleCase () const
bool isUpper () const
QChar::JoiningType joiningType () const
QChar mirroredChar () const
uchar row () const
QChar::Script script () const
QChar toCaseFolded () const
char toLatin1 () const
QChar toLower () const
QChar toTitleCase () const
QChar toUpper () const
ushort unicode () const
ushort & unicode ()
QChar::UnicodeVersion unicodeVersion () const

静态公共成员

QChar::Category category (uint ucs4 )
unsigned char combiningClass (uint ucs4 )
QChar::UnicodeVersion currentUnicodeVersion ()
QString decomposition (uint ucs4 )
QChar::Decomposition decompositionTag (uint ucs4 )
int digitValue (uint ucs4 )
QChar::Direction direction (uint ucs4 )
QChar fromLatin1 (char c )
bool hasMirrored (uint ucs4 )
ushort highSurrogate (uint ucs4 )
bool isDigit (uint ucs4 )
bool isHighSurrogate (uint ucs4 )
bool isLetter (uint ucs4 )
bool isLetterOrNumber (uint ucs4 )
bool isLowSurrogate (uint ucs4 )
bool isLower (uint ucs4 )
bool isMark (uint ucs4 )
bool isNonCharacter (uint ucs4 )
bool isNumber (uint ucs4 )
bool isPrint (uint ucs4 )
bool isPunct (uint ucs4 )
bool isSpace (uint ucs4 )
bool isSurrogate (uint ucs4 )
bool isSymbol (uint ucs4 )
bool isTitleCase (uint ucs4 )
bool isUpper (uint ucs4 )
QChar::JoiningType joiningType (uint ucs4 )
ushort lowSurrogate (uint ucs4 )
uint mirroredChar (uint ucs4 )
bool requiresSurrogates (uint ucs4 )
QChar::Script script (uint ucs4 )
uint surrogateToUcs4 (ushort high , ushort low )
uint surrogateToUcs4 (QChar high , QChar low )
uint toCaseFolded (uint ucs4 )
uint toLower (uint ucs4 )
uint toTitleCase (uint ucs4 )
uint toUpper (uint ucs4 )
QChar::UnicodeVersion unicodeVersion (uint ucs4 )
bool operator!= (QChar c1 , QChar c2 )
bool operator< (QChar c1 , QChar c2 )
QDataStream & operator<< (QDataStream & out , QChar chr )
bool operator<= (QChar c1 , QChar c2 )
bool operator== (QChar c1 , QChar c2 )
bool operator> (QChar c1 , QChar c2 )
bool operator>= (QChar c1 , QChar c2 )
QDataStream & operator>> (QDataStream & in , QChar & chr )

详细描述

在 Qt 中,Unicode 字符是没有任何标记 (或结构) 的 16 位实体。此类表示这种实体。它很轻量,所以可以在任何地方使用。大多数编译器视它像 unsigned short .

QChar 提供完全互补的测试/分类函数、转换到/来自其它格式、从将合成 Unicode 转换为分解 Unicode、及试着比较和大小写转换,若要求的话。

The classification functions include functions like those in the standard C++ header <cctype> (formerly <ctype.h>), but operating on the full range of Unicode characters, not just for the ASCII range. They all return true if the character is a certain type of character; otherwise they return false. These classification functions are isNull () (返回 true 若字符为 \0), isPrint () (true if the character is any sort of printable character, including whitespace), isPunct () (any sort of punctation), isMark () (Unicode 标记), isLetter () (字母), isNumber () (任意排序的数字字符,不仅仅 0-9), isLetterOrNumber (),和 isDigit () (decimal digits). All of these are wrappers around category () which return the Unicode-defined category of each character. Some of these also calculate the derived properties (for example isSpace () 返回 true if the character is of category Separator_* or an exceptional code point from Other_Control 类别)。

QChar 还提供 direction (), which indicates the "natural" writing direction of this character. The joiningType () function indicates how the character joins with it's neighbors (needed mostly for Arabic or Syriac) and finally hasMirrored (), which indicates whether the character needs to be mirrored when it is printed in it's "unnatural" writing direction.

合成的 Unicode 字符 (像 ring ) 可以被转换成分解 Unicode (a 之后紧跟 ring above) 通过使用 decomposition ().

In Unicode, comparison is not necessarily possible and case conversion is very difficult at best. Unicode, covering the "entire" world, also includes most of the world's case and sorting problems. operator==() and friends will do comparison based purely on the numeric Unicode value (code point) of the characters, and toUpper () 和 toLower () will do case changes when the character has a well-defined uppercase/lowercase equivalent. For locale-dependent comparisons, use QString::localeAwareCompare ().

转换函数包括 unicode () (到标量)、 toLatin1 () (到标量,但将所有非 Latin-1 字符转换成 0)、 row () (给出 Unicode 行)、 cell () (给出 Unicode 单元格)、 digitValue () (给出任意多数字字符的整数值)、及大量构造函数。

QChar 提供构造函数和铸造运算符,使之易于转换到和转换自传统 8 位 char 。若有定义 QT_NO_CAST_FROM_ASCII and QT_NO_CAST_TO_ASCII ,作为解释在 QString 文档编制,将需要明确调用 fromLatin1 (),或使用 QLatin1Char ,以构造 QChar 从 8 位 char ,和将需要调用 toLatin1 () 以获得 8 位值。

更多信息见 关于 Unicode 字符数据库 .

另请参阅 Unicode , QString ,和 QLatin1Char .

成员类型文档编制

enum QChar:: Category

此枚举映射 Unicode 字符类别。

以下是 Unicode 规范字符:

常量 描述
QChar::Mark_NonSpacing 0 Unicode 类名 Mn
QChar::Mark_SpacingCombining 1 Unicode 类名 Mc
QChar::Mark_Enclosing 2 Unicode 类名 Me
QChar::Number_DecimalDigit 3 Unicode 类名 Nd
QChar::Number_Letter 4 Unicode 类名 Nl
QChar::Number_Other 5 Unicode 类名 No
QChar::Separator_Space 6 Unicode 类名 Zs
QChar::Separator_Line 7 Unicode 类名 Zl
QChar::Separator_Paragraph 8 Unicode 类名 Zp
QChar::Other_Control 9 Unicode 类名 Cc
QChar::Other_Format 10 Unicode 类名 Cf
QChar::Other_Surrogate 11 Unicode 类名 Cs
QChar::Other_PrivateUse 12 Unicode 类名 Co
QChar::Other_NotAssigned 13 Unicode 类名 Cn

以下是 Unicode 情报类别:

常量 描述
QChar::Letter_Uppercase 14 Unicode 类名 Lu
QChar::Letter_Lowercase 15 Unicode 类名 Ll
QChar::Letter_Titlecase 16 Unicode 类名 Lt
QChar::Letter_Modifier 17 Unicode 类名 Lm
QChar::Letter_Other 18 Unicode 类名 Lo
QChar::Punctuation_Connector 19 Unicode 类名 Pc
QChar::Punctuation_Dash 20 Unicode 类名 Pd
QChar::Punctuation_Open 21 Unicode 类名 Ps
QChar::Punctuation_Close 22 Unicode 类名 Pe
QChar::Punctuation_InitialQuote 23 Unicode 类名 Pi
QChar::Punctuation_FinalQuote 24 Unicode 类名 Pf
QChar::Punctuation_Other 25 Unicode 类名 Po
QChar::Symbol_Math 26 Unicode 类名 Sm
QChar::Symbol_Currency 27 Unicode 类名 Sc
QChar::Symbol_Modifier 28 Unicode 类名 Sk
QChar::Symbol_Other 29 Unicode 类名 So

另请参阅 category ().

enum QChar:: Decomposition

This enum type defines the Unicode decomposition attributes. See the Unicode Standard for a description of the values.

常量
QChar::NoDecomposition 0
QChar::Canonical 1
QChar::Circle 8
QChar::Compat 16
QChar::Final 6
QChar::Font 2
QChar::Fraction 17
QChar::Initial 4
QChar::Isolated 7
QChar::Medial 5
QChar::Narrow 13
QChar::NoBreak 3
QChar::Small 14
QChar::Square 15
QChar::Sub 10
QChar::Super 9
QChar::Vertical 11
QChar::Wide 12

另请参阅 decomposition ().

enum QChar:: Direction

此枚举类型定义 Unicode 方向属性。见 Unicode 标准 了解值的描述。

为符合 C/C++ 命名约定,在 Unicode 标准使用的代码前置 Dir。

常量 描述
QChar::DirAL 13
QChar::DirAN 5
QChar::DirB 7
QChar::DirBN 18
QChar::DirCS 6
QChar::DirEN 2
QChar::DirES 3
QChar::DirET 4
QChar::DirFSI 21 Since Qt 5.3
QChar::DirL 0
QChar::DirLRE 11
QChar::DirLRI 19 Since Qt 5.3
QChar::DirLRO 12
QChar::DirNSM 17
QChar::DirON 10
QChar::DirPDF 16
QChar::DirPDI 22 Since Qt 5.3
QChar::DirR 1
QChar::DirRLE 14
QChar::DirRLI 20 Since Qt 5.3
QChar::DirRLO 15
QChar::DirS 8
QChar::DirWS 9

另请参阅 direction ().

enum QChar:: JoiningType

从 5.3 起

This enum type defines the Unicode joining type attributes. See the Unicode Standard for a description of the values.

为符合 C/C++ 命名约定,在 Unicode 标准使用的代码前置 Joining_。

常量
QChar::Joining_None 0
QChar::Joining_Causing 1
QChar::Joining_Dual 2
QChar::Joining_Right 3
QChar::Joining_Left 4
QChar::Joining_Transparent 5

另请参阅 joiningType ().

enum QChar:: Script

此枚举类型定义 Unicode 脚本特性值。

Unicode 脚本特性值的有关细节,见 Unicode 标准附录 #24 .

为符合 C/C++ 命名约定,在 Unicode 标准使用的代码前置 Script_。

常量 描述
QChar::Script_Unknown 0 For unassigned, private-use, noncharacter, and surrogate code points.
QChar::Script_Inherited 1 For characters that may be used with multiple scripts and that inherit their script from the preceding characters. These include nonspacing marks, enclosing marks, and zero width joiner/non-joiner characters.
QChar::Script_Common 2 For characters that may be used with multiple scripts and that do not inherit their script from the preceding characters.
QChar::Script_Adlam 132 Since Qt 5.11
QChar::Script_Ahom 126 Since Qt 5.6
QChar::Script_AnatolianHieroglyphs 127 Since Qt 5.6
QChar::Script_Arabic 8
QChar::Script_Armenian 6
QChar::Script_Avestan 80
QChar::Script_Balinese 62
QChar::Script_Bamum 84
QChar::Script_BassaVah 104 Since Qt 5.5
QChar::Script_Batak 93
QChar::Script_Bengali 12
QChar::Script_Bhaiksuki 133 Since Qt 5.11
QChar::Script_Bopomofo 36
QChar::Script_Brahmi 94
QChar::Script_Braille 54
QChar::Script_Buginese 55
QChar::Script_Buhid 44
QChar::Script_CanadianAboriginal 29
QChar::Script_Carian 75
QChar::Script_CaucasianAlbanian 103 Since Qt 5.5
QChar::Script_Chakma 96
QChar::Script_Cham 77
QChar::Script_Cherokee 28
QChar::Script_Chorasmian 153 Since Qt 5.15
QChar::Script_Coptic 46
QChar::Script_Cuneiform 63
QChar::Script_Cypriot 53
QChar::Script_Cyrillic 5
QChar::Script_Deseret 41
QChar::Script_Devanagari 11
QChar::Script_DivesAkuru 154 Since Qt 5.15
QChar::Script_Dogra 142 Since Qt 5.15
QChar::Script_Duployan 105 Since Qt 5.5
QChar::Script_EgyptianHieroglyphs 81
QChar::Script_Elbasan 106 Since Qt 5.5
QChar::Script_Elymaic 149 Since Qt 5.15
QChar::Script_Ethiopic 27
QChar::Script_Georgian 25
QChar::Script_Glagolitic 57
QChar::Script_Gothic 40
QChar::Script_Grantha 107 Since Qt 5.5
QChar::Script_Greek 4
QChar::Script_Gujarati 14
QChar::Script_GunjalaGondi 143 Since Qt 5.15
QChar::Script_Gurmukhi 13
QChar::Script_Han 37
QChar::Script_Hangul 26
QChar::Script_HanifiRohingya 144 Since Qt 5.15
QChar::Script_Hanunoo 43
QChar::Script_Hatran 128 Since Qt 5.6
QChar::Script_Hebrew 7
QChar::Script_Hiragana 34
QChar::Script_ImperialAramaic 87
QChar::Script_InscriptionalPahlavi 90
QChar::Script_InscriptionalParthian 89
QChar::Script_Javanese 85
QChar::Script_Kaithi 92
QChar::Script_Kannada 18
QChar::Script_Katakana 35
QChar::Script_KayahLi 72
QChar::Script_Kharoshthi 61
QChar::Script_KhitanSmallScript 155 Since Qt 5.15
QChar::Script_Khmer 32
QChar::Script_Khojki 109 Since Qt 5.5
QChar::Script_Khudawadi 123 Since Qt 5.5
QChar::Script_Lao 22
QChar::Script_Latin 3
QChar::Script_Lepcha 68
QChar::Script_Limbu 47
QChar::Script_LinearA 110 Since Qt 5.5
QChar::Script_LinearB 49
QChar::Script_Lisu 83
QChar::Script_Lycian 74
QChar::Script_Lydian 76
QChar::Script_Mahajani 111 Since Qt 5.5
QChar::Script_Makasar 145 Since Qt 5.15
QChar::Script_Malayalam 19
QChar::Script_Mandaic 95
QChar::Script_Manichaean 112 Since Qt 5.5
QChar::Script_Marchen 134 Since Qt 5.11
QChar::Script_MasaramGondi 138 Since Qt 5.11
QChar::Script_Medefaidrin 146 Since Qt 5.15
QChar::Script_MeeteiMayek 86
QChar::Script_MendeKikakui 113 Since Qt 5.5
QChar::Script_MeroiticCursive 97
QChar::Script_MeroiticHieroglyphs 98
QChar::Script_Miao 99
QChar::Script_Modi 114 Since Qt 5.5
QChar::Script_Mongolian 33
QChar::Script_Mro 115 Since Qt 5.5
QChar::Script_Multani 129 Since Qt 5.6
QChar::Script_Myanmar 24
QChar::Script_Nabataean 117 Since Qt 5.5
QChar::Script_Nandinagari 150 Since Qt 5.15
QChar::Script_Newa 135 Since Qt 5.11
QChar::Script_NewTaiLue 56
QChar::Script_Nko 66
QChar::Script_Nushu 139 Since Qt 5.11
QChar::Script_NyiakengPuachueHmong 151 Since Qt 5.15
QChar::Script_Ogham 30
QChar::Script_OlChiki 69
QChar::Script_OldHungarian 130 Since Qt 5.6
QChar::Script_OldItalic 39
QChar::Script_OldNorthArabian 116 Since Qt 5.5
QChar::Script_OldPermic 120 Since Qt 5.5
QChar::Script_OldPersian 60
QChar::Script_OldSogdian 147 Since Qt 5.15
QChar::Script_OldSouthArabian 88
QChar::Script_OldTurkic 91
QChar::Script_Oriya 15
QChar::Script_Osage 136 Since Qt 5.11
QChar::Script_Osmanya 52
QChar::Script_PahawhHmong 108 Since Qt 5.5
QChar::Script_Palmyrene 118 Since Qt 5.5
QChar::Script_PauCinHau 119 Since Qt 5.5
QChar::Script_PhagsPa 65
QChar::Script_Phoenician 64
QChar::Script_PsalterPahlavi 121 Since Qt 5.5
QChar::Script_Rejang 73
QChar::Script_Runic 31
QChar::Script_Samaritan 82
QChar::Script_Saurashtra 71
QChar::Script_Sharada 100
QChar::Script_Shavian 51
QChar::Script_Siddham 122 Since Qt 5.5
QChar::Script_SignWriting 131 Since Qt 5.6
QChar::Script_Sinhala 20
QChar::Script_Sogdian 148 Since Qt 5.15
QChar::Script_SoraSompeng 101
QChar::Script_Soyombo 140 Since Qt 5.11
QChar::Script_Sundanese 67
QChar::Script_SylotiNagri 59
QChar::Script_Syriac 9
QChar::Script_Tagalog 42
QChar::Script_Tagbanwa 45
QChar::Script_TaiLe 48
QChar::Script_TaiTham 78
QChar::Script_TaiViet 79
QChar::Script_Takri 102
QChar::Script_Tamil 16
QChar::Script_Tangut 137 Since Qt 5.11
QChar::Script_Telugu 17
QChar::Script_Thaana 10
QChar::Script_Thai 21
QChar::Script_Tibetan 23
QChar::Script_Tifinagh 58
QChar::Script_Tirhuta 124 Since Qt 5.5
QChar::Script_Ugaritic 50
QChar::Script_Vai 70
QChar::Script_Wancho 152 Since Qt 5.15
QChar::Script_WarangCiti 125 Since Qt 5.5
QChar::Script_Yezidi 156 Since Qt 5.15
QChar::Script_Yi 38
QChar::Script_ZanabazarSquare 141 Since Qt 5.11

该枚举在 Qt 5.1 引入或被修改。

另请参阅 script ().

enum QChar:: SpecialCharacter

常量 描述
QChar::Null 0x0000 A QChar 具有此值 isNull ().
QChar::Tabulation 0x0009 制表符。
QChar::LineFeed 0x000a
QChar::FormFeed 0x000c
QChar::CarriageReturn 0x000d
QChar::Space 0x0020
QChar::Nbsp 0x00a0 不间断空格。
QChar::SoftHyphen 0x00ad
QChar::ReplacementCharacter 0xfffd The character shown when a font has no glyph for a certain codepoint. A special question mark character is often used. Codecs use this codepoint when input data cannot be represented in Unicode.
QChar::ObjectReplacementCharacter 0xfffc Used to represent an object such as an image when such objects cannot be presented.
QChar::ByteOrderMark 0xfeff
QChar::ByteOrderSwapped 0xfffe
QChar::ParagraphSeparator 0x2029
QChar::LineSeparator 0x2028
QChar::LastValidCodePoint 0x10ffff

enum QChar:: UnicodeVersion

指定哪个版本的 Unicode 标准 引入某个字符。

常量 描述
QChar::Unicode_1_1 1 版本 1.1
QChar::Unicode_2_0 2 版本 2.0
QChar::Unicode_2_1_2 3 版本 2.1.2
QChar::Unicode_3_0 4 版本 3.0
QChar::Unicode_3_1 5 版本 3.1
QChar::Unicode_3_2 6 版本 3.2
QChar::Unicode_4_0 7 版本 4.0
QChar::Unicode_4_1 8 版本 4.1
QChar::Unicode_5_0 9 版本 5.0
QChar::Unicode_5_1 10 版本 5.1
QChar::Unicode_5_2 11 版本 5.2
QChar::Unicode_6_0 12 版本 6.0
QChar::Unicode_6_1 13 版本 6.1
QChar::Unicode_6_2 14 版本 6.2
QChar::Unicode_6_3 15 Version 6.3 Since Qt 5.3
QChar::Unicode_7_0 16 Version 7.0 Since Qt 5.5
QChar::Unicode_8_0 17 Version 8.0 Since Qt 5.6
QChar::Unicode_9_0 18 Version 9.0 Since Qt 5.11
QChar::Unicode_10_0 19 Version 10.0 Since Qt 5.11
QChar::Unicode_11_0 20 Version 11.0 Since Qt 5.15
QChar::Unicode_12_0 21 Version 12.0 Since Qt 5.15
QChar::Unicode_12_1 22 Version 12.1 Since Qt 5.15
QChar::Unicode_13_0 23 Version 13.0 Since Qt 5.15
QChar::Unicode_Unassigned 0 The value is not assigned to any character in version 8.0 of Unicode.

另请参阅 unicodeVersion () 和 currentUnicodeVersion ().

成员函数文档编制

QChar:: QChar ( uchar ch )

构造的 QChar 对应 ASCII/Latin-1 字符 ch .

注意: 此构造函数不可用当 QT_NO_CAST_FROM_ASCII or QT_RESTRICTED_CAST_FROM_ASCII 有定义。

另请参阅 QT_NO_CAST_FROM_ASCII and QT_RESTRICTED_CAST_FROM_ASCII .

QChar:: QChar ( char ch )

构造的 QChar 对应 ASCII/Latin-1 字符 ch .

注意: 此构造函数不可用当 QT_NO_CAST_FROM_ASCII 有定义。

另请参阅 QT_NO_CAST_FROM_ASCII .

QChar:: QChar ( wchar_t ch )

构造的 QChar 对应宽字符 ch .

注意: 此构造函数只可用于 Windows。

该函数在 Qt 5.10 引入。

QChar:: QChar ( char16_t ch )

构造的 QChar 对应 UTF-16 字符 ch .

该函数在 Qt 5.10 引入。

QChar:: QChar ( QLatin1Char ch )

构造的 QChar 对应 ASCII/Latin-1 字符 ch .

QChar:: QChar ( QChar::SpecialCharacter ch )

构造 QChar 为预定义字符值 ch .

QChar:: QChar ( int code )

构造 QChar 为字符具有 Unicode 代码点 code .

QChar:: QChar ( uint code )

构造 QChar 为字符具有 Unicode 代码点 code .

QChar:: QChar ( short code )

构造 QChar 为字符具有 Unicode 代码点 code .

QChar:: QChar ( uchar cell , uchar row )

构造 QChar 为 Unicode 单元格 cell 按行 row .

另请参阅 cell () 和 row ().

QChar:: QChar ( ushort code )

构造 QChar 为字符具有 Unicode 代码点 code .

QChar:: QChar ()

构造 null QChar('\0')。

另请参阅 isNull ().

QChar::Category QChar:: category () const

返回字符类别。

[static] QChar::Category QChar:: category ( uint ucs4 )

这是重载函数。

返回的 UCS-4 编码字符类别指定通过 ucs4 .

uchar QChar:: cell () const

返回 Unicode 字符单元格 (最低有效字节)。

另请参阅 row ().

unsigned char QChar:: combiningClass () const

Returns the combining class for the character as defined in the Unicode standard. This is mainly useful as a positioning hint for marks attached to a base character.

The Qt text rendering engine uses this information to correctly position non-spacing marks around a base character.

[static] unsigned char QChar:: combiningClass ( uint ucs4 )

这是重载函数。

返回 UCS-4 编码字符组合类指定通过 ucs4 ,如 Unicode 标准定义的。

[static] QChar::UnicodeVersion QChar:: currentUnicodeVersion ()

返回最近支持的 Unicode 版本。

QString QChar:: decomposition () const

将字符分解成其组成部分。返回空字符串,若不存在分解。

[static] QString QChar:: decomposition ( uint ucs4 )

这是重载函数。

分解 UCS-4 编码字符指定通过 ucs4 成其组成部分。返回空字符串,若不存在分解。

QChar::Decomposition QChar:: decompositionTag () const

返回字符合成定义标签。返回 QChar::NoDecomposition 若不存在分解。

[static] QChar::Decomposition QChar:: decompositionTag ( uint ucs4 )

这是重载函数。

返回 UCS-4 编码字符合成定义标签指定通过 ucs4 。返回 QChar::NoDecomposition 若不存在分解。

int QChar:: digitValue () const

返回数字的数值,或 -1 若字符不是数字。

[static] int QChar:: digitValue ( uint ucs4 )

这是重载函数。

返回数字的数值指定通过 UCS-4 编码字符 ucs4 ,或 -1 若字符不是数字。

QChar::Direction QChar:: direction () const

返回字符方向。

[static] QChar::Direction QChar:: direction ( uint ucs4 )

这是重载函数。

返回 UCS-4 编码字符方向指定通过 ucs4 .

[static] QChar QChar:: fromLatin1 ( char c )

转换 Latin-1 字符 c 到其等价 QChar 。这主要用于非国际化软件。

替代是使用 QLatin1Char .

另请参阅 toLatin1 () 和 unicode ().

bool QChar:: hasMirrored () const

返回 true 当应反转字符时,若文本方向相反;否则返回 false .

快一点相当于 (ch. mirroredChar () != ch).

另请参阅 mirroredChar ().

[static] bool QChar:: hasMirrored ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 应反转,若文本方向相反;否则返回 false .

快一点相当于 ( QChar::mirroredChar (ucs4) != ucs4).

该函数在 Qt 5.0 引入。

另请参阅 mirroredChar ().

[static] ushort QChar:: highSurrogate ( uint ucs4 )

Returns the high surrogate part of a UCS-4-encoded code point. The returned result is undefined if ucs4 is smaller than 0x10000.

bool QChar:: isDigit () const

返回 true 若字符是十进制数字 ( Number_DecimalDigit );否则返回 false .

另请参阅 isNumber ().

[static] bool QChar:: isDigit ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 是十进制数字 ( Number_DecimalDigit );否则返回 false .

该函数在 Qt 5.0 引入。

另请参阅 isNumber ().

bool QChar:: isHighSurrogate () const

返回 true QChar 是 UTF16 代理的高部分 (例如若其代码点在范围 [0xd800..0xdbff]);否则 false。

[static] bool QChar:: isHighSurrogate ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 是 UTF16 代理的高部分 (例如若其代码点在范围 [0xd800..0xdbff]);否则 false。

bool QChar:: isLetter () const

返回 true 若字符是字母 (Letter_* 类别);否则返回 false .

[static] bool QChar:: isLetter ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 是字母 (Letter_* 类别);否则返回 false .

该函数在 Qt 5.0 引入。

bool QChar:: isLetterOrNumber () const

返回 true if the character is a letter or number (Letter_* or Number_ * categories); otherwise returns false .

[static] bool QChar:: isLetterOrNumber ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 is a letter or number (Letter_* or Number_ * categories); otherwise returns false .

该函数在 Qt 5.0 引入。

bool QChar:: isLowSurrogate () const

返回 true QChar is the low part of a UTF16 surrogate (for example if its code point is in range [0xdc00..0xdfff]); false otherwise.

[static] bool QChar:: isLowSurrogate ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 is the low part of a UTF16 surrogate (for example if its code point is in range [0xdc00..0xdfff]); false otherwise.

bool QChar:: isLower () const

返回 true 若字符是小写字母,例如 category () 是 Letter_Lowercase .

另请参阅 isUpper (), toLower (),和 toUpper ().

[static] bool QChar:: isLower ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 是小写字母,例如 category () 是 Letter_Lowercase .

该函数在 Qt 5.0 引入。

另请参阅 isUpper (), toLower (),和 toUpper ().

bool QChar:: isMark () const

返回 true 若字符为标记 (Mark_* 类别);否则返回 false .

QChar::Category 了解一般标记的更多信息。

[static] bool QChar:: isMark ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 为标记 (Mark_* 类别); false .

该函数在 Qt 5.0 引入。

bool QChar:: isNonCharacter () const

返回 true QChar 为非字符;否则 false。

Unicode has a certain number of code points that are classified as "non-characters:" that is, they can be used for internal purposes in applications but cannot be used for text interchange. Those are the last two entries each Unicode Plane ([0xfffe..0xffff], [0x1fffe..0x1ffff], etc.) as well as the entries in range [0xfdd0..0xfdef].

该函数在 Qt 5.0 引入。

[static] bool QChar:: isNonCharacter ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 为非字符;否则 false。

Unicode has a certain number of code points that are classified as "non-characters:" that is, they can be used for internal purposes in applications but cannot be used for text interchange. Those are the last two entries each Unicode Plane ([0xfffe..0xffff], [0x1fffe..0x1ffff], etc.) as well as the entries in range [0xfdd0..0xfdef].

该函数在 Qt 5.0 引入。

bool QChar:: isNull () const

返回 true if the character is the Unicode character 0x0000 ('\0'); otherwise returns false .

bool QChar:: isNumber () const

返回 true if the character is a number ( Number_ * categories, not just 0-9); otherwise returns false .

另请参阅 isDigit ().

[static] bool QChar:: isNumber ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 is a number ( Number_ * categories, not just 0-9); otherwise returns false .

该函数在 Qt 5.0 引入。

另请参阅 isDigit ().

bool QChar:: isPrint () const

返回 true if the character is a printable character; otherwise returns false . This is any character not of category Other_ *.

Note that this gives no indication of whether the character is available in a particular font.

[static] bool QChar:: isPrint ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 is a printable character; otherwise returns false . This is any character not of category Other_ *.

Note that this gives no indication of whether the character is available in a particular font.

该函数在 Qt 5.0 引入。

bool QChar:: isPunct () const

返回 true 若字符为标点符号标记 (Punctuation_* 类别);否则返回 false .

[static] bool QChar:: isPunct ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 为标点符号标记 (Punctuation_* 类别);否则返回 false .

该函数在 Qt 5.0 引入。

bool QChar:: isSpace () const

返回 true if the character is a separator character (Separator_* categories or certain code points from Other_Control category); otherwise returns false .

[static] bool QChar:: isSpace ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 is a separator character (Separator_* categories or certain code points from Other_Control category); otherwise returns false .

该函数在 Qt 5.0 引入。

bool QChar:: isSurrogate () const

返回 true QChar contains a code point that is in either the high or the low part of the UTF-16 surrogate range (for example if its code point is in range [0xd800..0xdfff]); false otherwise.

该函数在 Qt 5.0 引入。

[static] bool QChar:: isSurrogate ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 contains a code point that is in either the high or the low part of the UTF-16 surrogate range (for example if its code point is in range [0xd800..0xdfff]); false otherwise.

该函数在 Qt 5.0 引入。

bool QChar:: isSymbol () const

返回 true 若字符为符号 (Symbol_* 类别);否则返回 false .

[static] bool QChar:: isSymbol ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 为符号 (Symbol_* 类别);否则返回 false .

该函数在 Qt 5.0 引入。

bool QChar:: isTitleCase () const

返回 true 若字符为标题大小写字母,例如 category () 是 Letter_Titlecase .

另请参阅 isLower (), toUpper (), toLower (),和 toTitleCase ().

[static] bool QChar:: isTitleCase ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 为标题大小写字母,例如 category () 是 Letter_Titlecase .

该函数在 Qt 5.0 引入。

另请参阅 isLower (), toUpper (), toLower (),和 toTitleCase ().

bool QChar:: isUpper () const

返回 true 若字符为大写字母,例如 category () 是 Letter_Uppercase .

另请参阅 isLower (), toUpper (),和 toLower ().

[static] bool QChar:: isUpper ( uint ucs4 )

这是重载函数。

返回 true 若 UCS-4 编码字符指定通过 ucs4 是大写字母,例如 category () 是 Letter_Uppercase .

该函数在 Qt 5.0 引入。

另请参阅 isLower (), toUpper (),和 toLower ().

QChar::JoiningType QChar:: joiningType () const

Returns information about the joining type attributes of the character (needed for certain languages such as Arabic or Syriac).

该函数在 Qt 5.3 引入。

[static] QChar::JoiningType QChar:: joiningType ( uint ucs4 )

这是重载函数。

Returns information about the joining type attributes of the UCS-4-encoded character specified by ucs4 (needed for certain languages such as Arabic or Syriac).

该函数在 Qt 5.3 引入。

[static] ushort QChar:: lowSurrogate ( uint ucs4 )

Returns the low surrogate part of a UCS-4-encoded code point. The returned result is undefined if ucs4 is smaller than 0x10000.

QChar QChar:: mirroredChar () const

Returns the mirrored character if this character is a mirrored character; otherwise returns the character itself.

另请参阅 hasMirrored ().

[static] uint QChar:: mirroredChar ( uint ucs4 )

这是重载函数。

Returns the mirrored character if the UCS-4-encoded character specified by ucs4 is a mirrored character; otherwise returns the character itself.

另请参阅 hasMirrored ().

[static] bool QChar:: requiresSurrogates ( uint ucs4 )

返回 true 若 UCS-4 编码字符指定通过 ucs4 can be split into the high and low parts of a UTF16 surrogate (for example if its code point is greater than or equals to 0x10000); false otherwise.

uchar QChar:: row () const

Returns the row (most significant byte) of the Unicode character.

另请参阅 cell ().

QChar::Script QChar:: script () const

返回用于此字符的 Unicode 脚本特性值。

该函数在 Qt 5.1 引入。

[static] QChar::Script QChar:: script ( uint ucs4 )

这是重载函数。

Returns the Unicode script property value for the character specified in its UCS-4-encoded form as ucs4 .

该函数在 Qt 5.1 引入。

[static] uint QChar:: surrogateToUcs4 ( ushort high , ushort low )

转换 UTF16 代理对采用给定 high and low 值,到其 UCS-4 编码代码点。

[static] uint QChar:: surrogateToUcs4 ( QChar high , QChar low )

这是重载函数。

转换 UTF16 代理对 ( high , low ) 到其 UCS-4 编码代码点。

QChar QChar:: toCaseFolded () const

Returns the case folded equivalent of the character. For most Unicode characters this is the same as toLower ().

[static] uint QChar:: toCaseFolded ( uint ucs4 )

这是重载函数。

Returns the case folded equivalent of the UCS-4-encoded character specified by ucs4 . For most Unicode characters this is the same as toLower ().

char QChar:: toLatin1 () const

返回的 Latin-1 字符相当于 QChar ,或 0。这主要用于非国际化软件。

注意: It is not possible to distinguish a non-Latin-1 character from a Latin-1 0 (NUL) character. Prefer to use unicode (), which does not have this ambiguity.

另请参阅 unicode ().

QChar QChar:: toLower () const

Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the character itself.

[static] uint QChar:: toLower ( uint ucs4 )

这是重载函数。

Returns the lowercase equivalent of the UCS-4-encoded character specified by ucs4 if the character is uppercase or titlecase; otherwise returns the character itself.

QChar QChar:: toTitleCase () const

Returns the title case equivalent if the character is lowercase or uppercase; otherwise returns the character itself.

[static] uint QChar:: toTitleCase ( uint ucs4 )

这是重载函数。

Returns the title case equivalent of the UCS-4-encoded character specified by ucs4 if the character is lowercase or uppercase; otherwise returns the character itself.

QChar QChar:: toUpper () const

Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the character itself.

[static] uint QChar:: toUpper ( uint ucs4 )

这是重载函数。

返回 UCS-4 编码字符的大写等价,指定通过 ucs4 若字符为小写 (或标题大小写);否则,返回字符自身。

ushort QChar:: unicode () const

返回数值 Unicode 值对于 QChar .

ushort &QChar:: unicode ()

返回数值 Unicode 值的引用对于 QChar .

QChar::UnicodeVersion QChar:: unicodeVersion () const

返回引入此字符的 Unicode 版本。

[static] QChar::UnicodeVersion QChar:: unicodeVersion ( uint ucs4 )

这是重载函数。

返回引入字符的 Unicode 版本, UCS-4 编码形式的指定为 ucs4 .

相关非成员

bool operator!= ( QChar c1 , QChar c2 )

返回 true if c1 and c2 不是相同 Unicode 字符;否则返回 false .

bool operator< ( QChar c1 , QChar c2 )

返回 true 若数值 Unicode 值对于 c1 小于 c2 ;否则返回 false .

QDataStream & operator<< ( QDataStream & out , QChar chr )

写入字符 chr 到流 out .

另请参阅 序列化 Qt 数据类型 .

bool operator<= ( QChar c1 , QChar c2 )

返回 true 若数值 Unicode 值对于 c1 <= c2 ;否则返回 false .

bool operator== ( QChar c1 , QChar c2 )

返回 true if c1 and c2 是相同 Unicode 字符;否则返回 false .

bool operator> ( QChar c1 , QChar c2 )

返回 true 若数值 Unicode 值对于 c1 大于 c2 ;否则返回 false .

bool operator>= ( QChar c1 , QChar c2 )

返回 true 若数值 Unicode 值对于 c1 >= c2 ;否则返回 false .

QDataStream & operator>> ( QDataStream & in , QChar & chr )

读取字符从流 in 到字符 chr .

另请参阅 序列化 Qt 数据类型 .