QChar Class
The QChar class provides a 16-bit Unicode code unit. More…
| Header | #include <QChar> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
List of all members, including inherited members
Public Types
| enum | SpecialCharacter |
| enum | Category |
| enum | Decomposition |
| enum | Direction |
| enum | JoiningType |
| enum | Script |
| enum | UnicodeVersion |
Public Functions
| QChar() | |
| QChar(char16_t c) | |
| QChar(char c) | |
| QChar(uchar c) | |
| QChar(short c) | |
| QChar(ushort c) | |
| QChar(int c) | |
| QChar(uint c) | |
| QChar(SpecialCharacter s) | |
| QChar(QLatin1Char c) | |
| char16_t | unicode() const |
| char16_t & | unicode() |
| uchar | cell() const |
| uchar | row() const |
| bool | isNull() const |
| char | toLatin1() const |
| Category | category() const |
| Decomposition | decompositionTag() const |
| QString | decomposition() const |
| unsigned char | combiningClass() const |
| Direction | direction() const |
| JoiningType | joiningType() const |
| Script | script() const |
| UnicodeVersion | unicodeVersion() const |
| bool | hasMirrored() const |
| QChar | mirroredChar() const |
| bool | isDigit() const |
| bool | isNumber() const |
| bool | isLetter() const |
| bool | isLetterOrNumber() const |
| bool | isSpace() const |
| bool | isUpper() const |
| bool | isLower() const |
| bool | isTitleCase() const |
| bool | isPunct() const |
| bool | isMark() const |
| bool | isSymbol() const |
| bool | isPrint() const |
| bool | isHighSurrogate() const |
| bool | isLowSurrogate() const |
| bool | isSurrogate() const |
| bool | isNonCharacter() const |
| int | digitValue() const |
| QChar | toLower() const |
| QChar | toUpper() const |
| QChar | toTitleCase() const |
| QChar | toCaseFolded() const |
Static Public Members
| QChar | fromLatin1(char c) |
| Decomposition | decompositionTag(char32_t ucs4) |
| QString | decomposition(char32_t ucs4) |
| unsigned char | combiningClass(char32_t ucs4) |
| Direction | direction(char32_t ucs4) |
| JoiningType | joiningType(char32_t ucs4) |
| Script | script(char32_t ucs4) |
| UnicodeVersion | unicodeVersion(char32_t ucs4) |
| UnicodeVersion | currentUnicodeVersion() |
| bool | hasMirrored(char32_t ucs4) |
| char32_t | mirroredChar(char32_t ucs4) |
| Category | category(char32_t ucs4) |
| bool | isDigit(char32_t ucs4) |
| bool | isNumber(char32_t ucs4) |
| bool | isLetter(char32_t ucs4) |
| bool | isLetterOrNumber(char32_t ucs4) |
| bool | isSpace(char32_t ucs4) |
| bool | isUpper(char32_t ucs4) |
| bool | isLower(char32_t ucs4) |
| bool | isTitleCase(char32_t ucs4) |
| bool | isPunct(char32_t ucs4) |
| bool | isMark(char32_t ucs4) |
| bool | isSymbol(char32_t ucs4) |
| bool | isPrint(char32_t ucs4) |
| int | digitValue(char32_t ucs4) |
| char32_t | toLower(char32_t ucs4) |
| char32_t | toUpper(char32_t ucs4) |
| char32_t | toTitleCase(char32_t ucs4) |
| char32_t | toCaseFolded(char32_t ucs4) |
| bool | isNonCharacter(char32_t ucs4) |
| bool | isHighSurrogate(char32_t ucs4) |
| bool | isLowSurrogate(char32_t ucs4) |
| bool | isSurrogate(char32_t ucs4) |
| bool | requiresSurrogates(char32_t ucs4) |
| char32_t | surrogateToUcs4(char16_t high, char16_t low) |
| char32_t | surrogateToUcs4(QChar high, QChar low) |
| char16_t | highSurrogate(char32_t ucs4) |
| char16_t | lowSurrogate(char32_t ucs4) |
| QtPrivate::Ucs4Chars | fromUcs4(char32_t c) |
Detailed Description
A QChar holds one UTF-16 code unit. Characters outside the Basic Multilingual Plane are represented by a pair of QChar surrogates; see isHighSurrogate(), isLowSurrogate() and surrogateToUcs4(). QChar is the element type of QString.
The classification functions (isLetter(), isSpace(), isUpper() and so on) and the case conversions (toLower(), toUpper(), toCaseFolded()) use the general categories and the simple case mappings of the Unicode database (version 16). Each also has a static overload that takes a full code point as a char32_t.
QChar::isLetter(U'\U0001D400'); // true: MATHEMATICAL BOLD CAPITAL A
QChar(u'Σ').toLower(); // σ
QChar(u'٣').digitValue(); // 3
The properties used for bidirectional text and shaping come from the same database: direction(), hasMirrored() and mirroredChar(), joiningType(), script() and unicodeVersion().
See also QString and QLatin1Char.
Differences from Qt
The numeric values of the Script enumerators follow Nt's own order (Unknown, Inherited, Common, then alphabetical) and differ from Qt's; use the names. Unassigned code points have the direction DirL rather than the default of their block. The deprecated Joining enum and joining() are not provided, and QChar has no char32_t constructor. digitValue() recognizes decimal digits only, not other numbers such as superscript digits.
Member Type Documentation
enum QChar::Category
The general category of a character in the Unicode database.
| Constant | Description |
|---|---|
QChar::Mark_NonSpacing | Mn, a non-spacing combining mark. |
QChar::Mark_SpacingCombining | Mc, a spacing combining mark. |
QChar::Mark_Enclosing | Me, an enclosing mark. |
QChar::Number_DecimalDigit | Nd, a decimal digit. |
QChar::Number_Letter | Nl, a letter-like number, such as a Roman numeral. |
QChar::Number_Other | No, another number, such as a superscript digit. |
QChar::Separator_Space | Zs, a space. |
QChar::Separator_Line | Zl, the line separator. |
QChar::Separator_Paragraph | Zp, the paragraph separator. |
QChar::Other_Control | Cc, a control character. |
QChar::Other_Format | Cf, a format character. |
QChar::Other_Surrogate | Cs, a surrogate. |
QChar::Other_PrivateUse | Co, a private-use character. |
QChar::Other_NotAssigned | Cn, a code point that is not assigned. |
QChar::Letter_Uppercase | Lu, an uppercase letter. |
QChar::Letter_Lowercase | Ll, a lowercase letter. |
QChar::Letter_Titlecase | Lt, a titlecase letter, such as U+01C5. |
QChar::Letter_Modifier | Lm, a modifier letter. |
QChar::Letter_Other | Lo, another letter, such as an ideograph. |
QChar::Punctuation_Connector | Pc, connector punctuation, such as the underscore. |
QChar::Punctuation_Dash | Pd, a dash. |
QChar::Punctuation_Open | Ps, opening punctuation, such as a parenthesis. |
QChar::Punctuation_Close | Pe, closing punctuation. |
QChar::Punctuation_InitialQuote | Pi, an initial quotation mark. |
QChar::Punctuation_FinalQuote | Pf, a final quotation mark. |
QChar::Punctuation_Other | Po, other punctuation. |
QChar::Symbol_Math | Sm, a mathematical symbol. |
QChar::Symbol_Currency | Sc, a currency symbol. |
QChar::Symbol_Modifier | Sk, a modifier symbol. |
QChar::Symbol_Other | So, another symbol. |
enum QChar::Decomposition
The kind of a character's decomposition mapping, from the tags of the Unicode Character Database.
| Constant | Description |
|---|---|
QChar::NoDecomposition | The character has no decomposition. |
QChar::Canonical | A canonical decomposition. |
QChar::Font | A font variant. |
QChar::NoBreak | A no-break version of a space or hyphen. |
QChar::Initial | An initial presentation form (Arabic). |
QChar::Medial | A medial presentation form (Arabic). |
QChar::Final | A final presentation form (Arabic). |
QChar::Isolated | An isolated presentation form (Arabic). |
QChar::Circle | An encircled form. |
QChar::Super | A superscript form. |
QChar::Sub | A subscript form. |
QChar::Vertical | A vertical layout presentation form. |
QChar::Wide | A wide (zenkaku) compatibility character. |
QChar::Narrow | A narrow (hankaku) compatibility character. |
QChar::Small | A small variant form. |
QChar::Square | A CJK squared font variant. |
QChar::Compat | Another compatibility character. |
QChar::Fraction | A vulgar fraction form. |
enum QChar::Direction
The bidirectional class of a character, from the Unicode Character Database, used by the bidirectional algorithm (UAX #9).
| Constant | Description |
|---|---|
QChar::DirL | Left-to-right. |
QChar::DirR | Right-to-left. |
QChar::DirEN | European number. |
QChar::DirES | European number separator. |
QChar::DirET | European number terminator. |
QChar::DirAN | Arabic number. |
QChar::DirCS | Common number separator. |
QChar::DirB | Paragraph separator. |
QChar::DirS | Segment separator, such as a tab. |
QChar::DirWS | Whitespace. |
QChar::DirON | Other neutral. |
QChar::DirLRE | Left-to-right embedding. |
QChar::DirLRO | Left-to-right override. |
QChar::DirAL | Right-to-left Arabic letter. |
QChar::DirRLE | Right-to-left embedding. |
QChar::DirRLO | Right-to-left override. |
QChar::DirPDF | Pop directional format. |
QChar::DirNSM | Nonspacing mark. |
QChar::DirBN | Boundary neutral. |
QChar::DirLRI | Left-to-right isolate. |
QChar::DirRLI | Right-to-left isolate. |
QChar::DirFSI | First strong isolate. |
QChar::DirPDI | Pop directional isolate. |
enum QChar::JoiningType
How a character joins its neighbours in cursive scripts such as Arabic and Syriac (ArabicShaping.txt).
| Constant | Description |
|---|---|
QChar::Joining_None | The character does not join. |
QChar::Joining_Causing | The character causes joining, like U+200D ZERO WIDTH JOINER. |
QChar::Joining_Dual | The character joins on both sides. |
QChar::Joining_Right | The character joins on its right side only. |
QChar::Joining_Left | The character joins on its left side only. |
QChar::Joining_Transparent | The character does not affect joining, like most combining marks. |
enum QChar::Script
The script of a character (Scripts.txt of the Unicode Character Database).
| Constant | Description |
|---|---|
QChar::Script_Unknown | Unassigned, private-use and other characters that belong to no script. |
QChar::Script_Inherited | Combining marks that take the script of the character they follow. |
QChar::Script_Common | Characters used by several scripts, such as punctuation, digits and symbols. |
QChar::Script_Adlam | Adlam. |
QChar::Script_Ahom | Ahom. |
QChar::Script_AnatolianHieroglyphs | Anatolian Hieroglyphs. |
QChar::Script_Arabic | Arabic. |
QChar::Script_Armenian | Armenian. |
QChar::Script_Avestan | Avestan. |
QChar::Script_Balinese | Balinese. |
QChar::Script_Bamum | Bamum. |
QChar::Script_BassaVah | Bassa Vah. |
QChar::Script_Batak | Batak. |
QChar::Script_Bengali | Bengali. |
QChar::Script_Bhaiksuki | Bhaiksuki. |
QChar::Script_Bopomofo | Bopomofo. |
QChar::Script_Brahmi | Brahmi. |
QChar::Script_Braille | Braille. |
QChar::Script_Buginese | Buginese. |
QChar::Script_Buhid | Buhid. |
QChar::Script_CanadianAboriginal | Canadian Aboriginal. |
QChar::Script_Carian | Carian. |
QChar::Script_CaucasianAlbanian | Caucasian Albanian. |
QChar::Script_Chakma | Chakma. |
QChar::Script_Cham | Cham. |
QChar::Script_Cherokee | Cherokee. |
QChar::Script_Chorasmian | Chorasmian. |
QChar::Script_Coptic | Coptic. |
QChar::Script_Cuneiform | Cuneiform. |
QChar::Script_Cypriot | Cypriot. |
QChar::Script_CyproMinoan | Cypro Minoan. |
QChar::Script_Cyrillic | Cyrillic. |
QChar::Script_Deseret | Deseret. |
QChar::Script_Devanagari | Devanagari. |
QChar::Script_DivesAkuru | Dives Akuru. |
QChar::Script_Dogra | Dogra. |
QChar::Script_Duployan | Duployan. |
QChar::Script_EgyptianHieroglyphs | Egyptian Hieroglyphs. |
QChar::Script_Elbasan | Elbasan. |
QChar::Script_Elymaic | Elymaic. |
QChar::Script_Ethiopic | Ethiopic. |
QChar::Script_Garay | Garay. |
QChar::Script_Georgian | Georgian. |
QChar::Script_Glagolitic | Glagolitic. |
QChar::Script_Gothic | Gothic. |
QChar::Script_Grantha | Grantha. |
QChar::Script_Greek | Greek. |
QChar::Script_Gujarati | Gujarati. |
QChar::Script_GunjalaGondi | Gunjala Gondi. |
QChar::Script_Gurmukhi | Gurmukhi. |
QChar::Script_GurungKhema | Gurung Khema. |
QChar::Script_Han | Han. |
QChar::Script_Hangul | Hangul. |
QChar::Script_HanifiRohingya | Hanifi Rohingya. |
QChar::Script_Hanunoo | Hanunoo. |
QChar::Script_Hatran | Hatran. |
QChar::Script_Hebrew | Hebrew. |
QChar::Script_Hiragana | Hiragana. |
QChar::Script_ImperialAramaic | Imperial Aramaic. |
QChar::Script_InscriptionalPahlavi | Inscriptional Pahlavi. |
QChar::Script_InscriptionalParthian | Inscriptional Parthian. |
QChar::Script_Javanese | Javanese. |
QChar::Script_Kaithi | Kaithi. |
QChar::Script_Kannada | Kannada. |
QChar::Script_Katakana | Katakana. |
QChar::Script_Kawi | Kawi. |
QChar::Script_KayahLi | Kayah Li. |
QChar::Script_Kharoshthi | Kharoshthi. |
QChar::Script_KhitanSmallScript | Khitan Small Script. |
QChar::Script_Khmer | Khmer. |
QChar::Script_Khojki | Khojki. |
QChar::Script_Khudawadi | Khudawadi. |
QChar::Script_KiratRai | Kirat Rai. |
QChar::Script_Lao | Lao. |
QChar::Script_Latin | Latin. |
QChar::Script_Lepcha | Lepcha. |
QChar::Script_Limbu | Limbu. |
QChar::Script_LinearA | Linear A. |
QChar::Script_LinearB | Linear B. |
QChar::Script_Lisu | Lisu. |
QChar::Script_Lycian | Lycian. |
QChar::Script_Lydian | Lydian. |
QChar::Script_Mahajani | Mahajani. |
QChar::Script_Makasar | Makasar. |
QChar::Script_Malayalam | Malayalam. |
QChar::Script_Mandaic | Mandaic. |
QChar::Script_Manichaean | Manichaean. |
QChar::Script_Marchen | Marchen. |
QChar::Script_MasaramGondi | Masaram Gondi. |
QChar::Script_Medefaidrin | Medefaidrin. |
QChar::Script_MeeteiMayek | Meetei Mayek. |
QChar::Script_MendeKikakui | Mende Kikakui. |
QChar::Script_MeroiticCursive | Meroitic Cursive. |
QChar::Script_MeroiticHieroglyphs | Meroitic Hieroglyphs. |
QChar::Script_Miao | Miao. |
QChar::Script_Modi | Modi. |
QChar::Script_Mongolian | Mongolian. |
QChar::Script_Mro | Mro. |
QChar::Script_Multani | Multani. |
QChar::Script_Myanmar | Myanmar. |
QChar::Script_Nabataean | Nabataean. |
QChar::Script_NagMundari | Nag Mundari. |
QChar::Script_Nandinagari | Nandinagari. |
QChar::Script_NewTaiLue | New Tai Lue. |
QChar::Script_Newa | Newa. |
QChar::Script_Nko | Nko. |
QChar::Script_Nushu | Nushu. |
QChar::Script_NyiakengPuachueHmong | Nyiakeng Puachue Hmong. |
QChar::Script_Ogham | Ogham. |
QChar::Script_OlChiki | Ol Chiki. |
QChar::Script_OlOnal | Ol Onal. |
QChar::Script_OldHungarian | Old Hungarian. |
QChar::Script_OldItalic | Old Italic. |
QChar::Script_OldNorthArabian | Old North Arabian. |
QChar::Script_OldPermic | Old Permic. |
QChar::Script_OldPersian | Old Persian. |
QChar::Script_OldSogdian | Old Sogdian. |
QChar::Script_OldSouthArabian | Old South Arabian. |
QChar::Script_OldTurkic | Old Turkic. |
QChar::Script_OldUyghur | Old Uyghur. |
QChar::Script_Oriya | Oriya. |
QChar::Script_Osage | Osage. |
QChar::Script_Osmanya | Osmanya. |
QChar::Script_PahawhHmong | Pahawh Hmong. |
QChar::Script_Palmyrene | Palmyrene. |
QChar::Script_PauCinHau | Pau Cin Hau. |
QChar::Script_PhagsPa | Phags Pa. |
QChar::Script_Phoenician | Phoenician. |
QChar::Script_PsalterPahlavi | Psalter Pahlavi. |
QChar::Script_Rejang | Rejang. |
QChar::Script_Runic | Runic. |
QChar::Script_Samaritan | Samaritan. |
QChar::Script_Saurashtra | Saurashtra. |
QChar::Script_Sharada | Sharada. |
QChar::Script_Shavian | Shavian. |
QChar::Script_Siddham | Siddham. |
QChar::Script_SignWriting | SignWriting. |
QChar::Script_Sinhala | Sinhala. |
QChar::Script_Sogdian | Sogdian. |
QChar::Script_SoraSompeng | Sora Sompeng. |
QChar::Script_Soyombo | Soyombo. |
QChar::Script_Sundanese | Sundanese. |
QChar::Script_Sunuwar | Sunuwar. |
QChar::Script_SylotiNagri | Syloti Nagri. |
QChar::Script_Syriac | Syriac. |
QChar::Script_Tagalog | Tagalog. |
QChar::Script_Tagbanwa | Tagbanwa. |
QChar::Script_TaiLe | Tai Le. |
QChar::Script_TaiTham | Tai Tham. |
QChar::Script_TaiViet | Tai Viet. |
QChar::Script_Takri | Takri. |
QChar::Script_Tamil | Tamil. |
QChar::Script_Tangsa | Tangsa. |
QChar::Script_Tangut | Tangut. |
QChar::Script_Telugu | Telugu. |
QChar::Script_Thaana | Thaana. |
QChar::Script_Thai | Thai. |
QChar::Script_Tibetan | Tibetan. |
QChar::Script_Tifinagh | Tifinagh. |
QChar::Script_Tirhuta | Tirhuta. |
QChar::Script_Todhri | Todhri. |
QChar::Script_Toto | Toto. |
QChar::Script_TuluTigalari | Tulu Tigalari. |
QChar::Script_Ugaritic | Ugaritic. |
QChar::Script_Vai | Vai. |
QChar::Script_Vithkuqi | Vithkuqi. |
QChar::Script_Wancho | Wancho. |
QChar::Script_WarangCiti | Warang Citi. |
QChar::Script_Yezidi | Yezidi. |
QChar::Script_Yi | Yi. |
QChar::Script_ZanabazarSquare | Zanabazar Square. |
QChar::ScriptCount | The number of scripts; not a script. |
enum QChar::SpecialCharacter
Names for commonly used code points.
| Constant | Description |
|---|---|
QChar::Null | U+0000, the null character. |
QChar::Tabulation | U+0009, horizontal tabulation. |
QChar::LineFeed | U+000A, line feed. |
QChar::CarriageReturn | U+000D, carriage return. |
QChar::Space | U+0020, the space character. |
QChar::Nbsp | U+00A0, the no-break space. |
QChar::SoftHyphen | U+00AD, the soft hyphen. |
QChar::ReplacementCharacter | U+FFFD, used in place of invalid or unrepresentable input. |
QChar::ObjectReplacementCharacter | U+FFFC, the object replacement character. |
QChar::ByteOrderMark | U+FEFF, the byte order mark. |
QChar::ByteOrderSwapped | U+FFFE, a byte order mark read with the wrong byte order. |
QChar::ParagraphSeparator | U+2029, the paragraph separator. |
QChar::LineSeparator | U+2028, the line separator. |
QChar::VisualTabCharacter | U+2192, the arrow some editors draw for a tab. |
QChar::LastValidCodePoint | U+10FFFF, the last valid Unicode code point. |
enum QChar::UnicodeVersion
The version of Unicode that assigned a character.
| Constant | Description |
|---|---|
QChar::Unicode_Unassigned | The character is not assigned. |
QChar::Unicode_1_1 | Version 1.1. |
QChar::Unicode_2_0 | Version 2.0. |
QChar::Unicode_2_1_2 | Version 2.1.2. |
QChar::Unicode_3_0 | Version 3.0. |
QChar::Unicode_3_1 | Version 3.1. |
QChar::Unicode_3_2 | Version 3.2. |
QChar::Unicode_4_0 | Version 4.0. |
QChar::Unicode_4_1 | Version 4.1. |
QChar::Unicode_5_0 | Version 5.0. |
QChar::Unicode_5_1 | Version 5.1. |
QChar::Unicode_5_2 | Version 5.2. |
QChar::Unicode_6_0 | Version 6.0. |
QChar::Unicode_6_1 | Version 6.1. |
QChar::Unicode_6_2 | Version 6.2. |
QChar::Unicode_6_3 | Version 6.3. |
QChar::Unicode_7_0 | Version 7.0. |
QChar::Unicode_8_0 | Version 8.0. |
QChar::Unicode_9_0 | Version 9.0. |
QChar::Unicode_10_0 | Version 10.0. |
QChar::Unicode_11_0 | Version 11.0. |
QChar::Unicode_12_0 | Version 12.0. |
QChar::Unicode_12_1 | Version 12.1. |
QChar::Unicode_13_0 | Version 13.0. |
QChar::Unicode_14_0 | Version 14.0. |
QChar::Unicode_15_0 | Version 15.0. |
QChar::Unicode_15_1 | Version 15.1. |
QChar::Unicode_16_0 | Version 16.0. |
Member Function Documentation
QChar::QChar()
Constructs a null character (U+0000).
See also isNull().
QChar::QChar(char16_t c)
Constructs a character with the UTF-16 code unit c.
QChar::QChar(char c)
This is an overloaded function.
Constructs a character from the Latin-1 byte c. The byte is zero-extended, not interpreted as a signed value.
QChar::QChar(uchar c)
This is an overloaded function.
Constructs a character with the code unit c.
QChar::QChar(short c)
This is an overloaded function.
Constructs a character with the code unit c, reinterpreted as an unsigned 16-bit value.
QChar::QChar(ushort c)
This is an overloaded function.
Constructs a character with the code unit c.
QChar::QChar(int c)
This is an overloaded function.
Constructs a character from c, truncated to 16 bits.
QChar::QChar(uint c)
This is an overloaded function.
Constructs a character from c, truncated to 16 bits.
QChar::QChar(SpecialCharacter s)
This is an overloaded function.
Constructs a character with the code point of the special character s.
QChar::QChar(QLatin1Char c)
This is an overloaded function.
Constructs a character from the Latin-1 character c.
Category QChar::category() const
Returns the general category of this character.
Category QChar::category(char32_t ucs4)
Returns the general category of the code point ucs4.
uchar QChar::cell() const
Returns the low byte of the code unit (the "cell" within its row).
unsigned char QChar::combiningClass() const
Returns the canonical combining class of this character, which orders combining marks during normalization; 0 for most characters.
See also QString::normalized().
unsigned char QChar::combiningClass(char32_t ucs4)
This is an overloaded function.
Returns the canonical combining class of ucs4.
UnicodeVersion QChar::currentUnicodeVersion()
Returns the version of the Unicode Character Database that Nt's tables were generated from.
See also unicodeVersion().
QString QChar::decomposition() const
Returns this character's decomposition mapping: the characters it decomposes into, one level deep, or an empty string if it has none.
See also decompositionTag() and QString::normalized().
QString QChar::decomposition(char32_t ucs4)
This is an overloaded function.
Returns the one-level decomposition mapping of ucs4.
Decomposition QChar::decompositionTag() const
Returns the tag of this character's decomposition mapping, or NoDecomposition.
See also decomposition().
Decomposition QChar::decompositionTag(char32_t ucs4)
This is an overloaded function.
Returns the tag of the decomposition mapping of ucs4.
int QChar::digitValue() const
Returns the value of this character if it is a decimal digit of any script; otherwise returns -1.
See also isDigit().
int QChar::digitValue(char32_t ucs4)
This is an overloaded function.
Returns the value of ucs4 if it is a decimal digit, or -1.
Direction QChar::direction() const
Returns the bidirectional class of this character.
See also hasMirrored() and QString::isRightToLeft().
Direction QChar::direction(char32_t ucs4)
This is an overloaded function.
Returns the bidirectional class of ucs4.
QChar QChar::fromLatin1(char c)
Converts the Latin-1 byte c to a QChar.
See also toLatin1().
QtPrivate::Ucs4Chars QChar::fromUcs4(char32_t c)
Returns the UTF-16 code units of the code point c: one, or a surrogate pair. The result converts to QStringView, and has size(), data(), begin() and end():
QString s = "smile ";
s += QStringView(QChar::fromUcs4(U'\U0001F600')); // two code units
This function was introduced in 6.0.
bool QChar::hasMirrored() const
Returns true if this character is mirrored when it appears in right-to-left text, such as a parenthesis; otherwise returns false.
See also mirroredChar().
bool QChar::hasMirrored(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is mirrored in right-to-left text.
char16_t QChar::highSurrogate(char32_t ucs4)
Returns the high surrogate of the code point ucs4, which must require surrogates.
bool QChar::isDigit() const
Returns true if this is a decimal digit of any script (category Number_DecimalDigit); otherwise returns false.
See also isNumber() and digitValue().
bool QChar::isDigit(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is a decimal digit of any script.
bool QChar::isHighSurrogate() const
Returns true if this is a UTF-16 high surrogate (U+D800 to U+DBFF); otherwise returns false.
See also isLowSurrogate() and isSurrogate().
bool QChar::isHighSurrogate(char32_t ucs4)
Returns true if ucs4 is a high surrogate; otherwise returns false.
bool QChar::isLetter() const
Returns true if this is a letter (any Letter_* category); otherwise returns false.
See also isLetterOrNumber(), isUpper() and isLower().
bool QChar::isLetter(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is a letter.
bool QChar::isLetterOrNumber() const
Returns true if this is a letter or a number; otherwise returns false.
See also isLetter() and isNumber().
bool QChar::isLetterOrNumber(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is a letter or a number.
bool QChar::isLower() const
Returns true if this is a lowercase letter (Letter_Lowercase); otherwise returns false.
See also isUpper() and toLower().
bool QChar::isLower(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is a lowercase letter.
bool QChar::isLowSurrogate() const
Returns true if this is a UTF-16 low surrogate (U+DC00 to U+DFFF); otherwise returns false.
See also isHighSurrogate() and isSurrogate().
bool QChar::isLowSurrogate(char32_t ucs4)
Returns true if ucs4 is a low surrogate; otherwise returns false.
bool QChar::isMark() const
Returns true if this is a combining mark (any Mark_* category); otherwise returns false.
bool QChar::isMark(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is a combining mark.
bool QChar::isNonCharacter() const
Returns true if this is a noncharacter, such as U+FFFE; otherwise returns false.
bool QChar::isNonCharacter(char32_t ucs4)
Returns true if ucs4 is a noncharacter (U+FDD0 to U+FDEF, or a code point ending in FFFE or FFFF); otherwise returns false.
bool QChar::isNull() const
Returns true if this is the null character (U+0000); otherwise returns false.
bool QChar::isNumber() const
Returns true if this is a number (any Number_* category); otherwise returns false.
See also isDigit() and isLetterOrNumber().
bool QChar::isNumber(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is a number of any kind.
bool QChar::isPrint() const
Returns true if this is a printable character, that is, neither a control character nor an unassigned code point; otherwise returns false.
bool QChar::isPrint(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is printable: neither a control character nor unassigned.
bool QChar::isPunct() const
Returns true if this is a punctuation character (any Punctuation_* category); otherwise returns false.
bool QChar::isPunct(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is punctuation.
bool QChar::isSpace() const
Returns true if this is a white space character: a Separator_* character, U+0009 to U+000D or U+0085; otherwise returns false.
bool QChar::isSpace(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is white space.
bool QChar::isSurrogate() const
Returns true if this is a UTF-16 surrogate (U+D800 to U+DFFF); otherwise returns false.
See also isHighSurrogate() and isLowSurrogate().
bool QChar::isSurrogate(char32_t ucs4)
Returns true if ucs4 is a surrogate; otherwise returns false.
bool QChar::isSymbol() const
Returns true if this is a symbol (any Symbol_* category); otherwise returns false.
bool QChar::isSymbol(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is a symbol.
bool QChar::isTitleCase() const
Returns true if this is a titlecase letter (Letter_Titlecase), such as U+01C5; otherwise returns false.
See also toTitleCase().
bool QChar::isTitleCase(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is a titlecase letter.
bool QChar::isUpper() const
Returns true if this is an uppercase letter (Letter_Uppercase); otherwise returns false.
See also isLower(), isTitleCase() and toUpper().
bool QChar::isUpper(char32_t ucs4)
This is an overloaded function.
Returns true if ucs4 is an uppercase letter.
JoiningType QChar::joiningType() const
Returns how this character joins its neighbours in cursive scripts.
JoiningType QChar::joiningType(char32_t ucs4)
This is an overloaded function.
Returns the joining type of ucs4.
char16_t QChar::lowSurrogate(char32_t ucs4)
Returns the low surrogate of the code point ucs4, which must require surrogates.
QChar QChar::mirroredChar() const
Returns the mirror image of this character, such as ) for (, or the character itself if it has none.
See also hasMirrored().
char32_t QChar::mirroredChar(char32_t ucs4)
This is an overloaded function.
Returns the mirror image of ucs4, or ucs4 itself if it has none.
bool QChar::requiresSurrogates(char32_t ucs4)
Returns true if ucs4 lies outside the Basic Multilingual Plane and so needs a surrogate pair in UTF-16; otherwise returns false.
uchar QChar::row() const
Returns the high byte of the code unit (the "row" of its plane).
See also cell() and unicode().
Script QChar::script() const
Returns the script this character belongs to.
Script QChar::script(char32_t ucs4)
This is an overloaded function.
Returns the script of ucs4; Script_Unknown for code points that are not assigned.
char32_t QChar::surrogateToUcs4(char16_t high, char16_t low)
Returns the code point of the surrogate pair high and low.
char32_t QChar::surrogateToUcs4(QChar high, QChar low)
This is an overloaded function.
Returns the code point of the surrogate pair high and low.
QChar QChar::toCaseFolded() const
Returns the case folded equivalent of this character, which is used to compare text regardless of case.
See also toLower() and QString::toCaseFolded().
char32_t QChar::toCaseFolded(char32_t ucs4)
This is an overloaded function.
Returns the simple case folding of ucs4.
char QChar::toLatin1() const
Returns the Latin-1 representation of this character, or '\\0' if it is outside the range 0 to 255.
See also fromLatin1() and unicode().
QChar QChar::toLower() const
Returns the lowercase equivalent of this character, or the character itself if it has none. The mapping is the simple (one-to-one) mapping of Unicode.
See also toUpper(), toCaseFolded() and QString::toLower().
char32_t QChar::toLower(char32_t ucs4)
This is an overloaded function.
Returns the simple lowercase mapping of ucs4.
QChar QChar::toTitleCase() const
Returns the titlecase equivalent of this character, or the character itself if it has none.
See also toUpper() and isTitleCase().
char32_t QChar::toTitleCase(char32_t ucs4)
This is an overloaded function.
Returns the simple titlecase mapping of ucs4.
QChar QChar::toUpper() const
Returns the uppercase equivalent of this character, or the character itself if it has none. The mapping is the simple (one-to-one) mapping of Unicode, so U+00DF stays as it is; QString::toUpper() uses the full mapping.
See also toLower(), toTitleCase() and QString::toUpper().
char32_t QChar::toUpper(char32_t ucs4)
This is an overloaded function.
Returns the simple uppercase mapping of ucs4.
char16_t QChar::unicode() const
Returns the UTF-16 code unit of this character.
char16_t & QChar::unicode()
This is an overloaded function.
Returns a reference to the UTF-16 code unit of this character, which can be used to modify it.
UnicodeVersion QChar::unicodeVersion() const
Returns the Unicode version that assigned this character, or Unicode_Unassigned.
See also currentUnicodeVersion().
UnicodeVersion QChar::unicodeVersion(char32_t ucs4)
This is an overloaded function.
Returns the Unicode version that assigned ucs4.