6.0.0-rc4Source

QChar Class

The QChar class provides a 16-bit Unicode code unit. More…

Header#include <QChar>
CMaketarget_link_libraries(app PRIVATE Nt::Core)
ModuleNt Core C++ Classes

List of all members, including inherited members

Public Types

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_tunicode() const
char16_t &unicode()
ucharcell() const
ucharrow() const
boolisNull() const
chartoLatin1() const
Categorycategory() const
DecompositiondecompositionTag() const
QStringdecomposition() const
unsigned charcombiningClass() const
Directiondirection() const
JoiningTypejoiningType() const
Scriptscript() const
UnicodeVersionunicodeVersion() const
boolhasMirrored() const
QCharmirroredChar() const
boolisDigit() const
boolisNumber() const
boolisLetter() const
boolisLetterOrNumber() const
boolisSpace() const
boolisUpper() const
boolisLower() const
boolisTitleCase() const
boolisPunct() const
boolisMark() const
boolisSymbol() const
boolisPrint() const
boolisHighSurrogate() const
boolisLowSurrogate() const
boolisSurrogate() const
boolisNonCharacter() const
intdigitValue() const
QChartoLower() const
QChartoUpper() const
QChartoTitleCase() const
QChartoCaseFolded() const

Static Public Members

QCharfromLatin1(char c)
DecompositiondecompositionTag(char32_t ucs4)
QStringdecomposition(char32_t ucs4)
unsigned charcombiningClass(char32_t ucs4)
Directiondirection(char32_t ucs4)
JoiningTypejoiningType(char32_t ucs4)
Scriptscript(char32_t ucs4)
UnicodeVersionunicodeVersion(char32_t ucs4)
UnicodeVersioncurrentUnicodeVersion()
boolhasMirrored(char32_t ucs4)
char32_tmirroredChar(char32_t ucs4)
Categorycategory(char32_t ucs4)
boolisDigit(char32_t ucs4)
boolisNumber(char32_t ucs4)
boolisLetter(char32_t ucs4)
boolisLetterOrNumber(char32_t ucs4)
boolisSpace(char32_t ucs4)
boolisUpper(char32_t ucs4)
boolisLower(char32_t ucs4)
boolisTitleCase(char32_t ucs4)
boolisPunct(char32_t ucs4)
boolisMark(char32_t ucs4)
boolisSymbol(char32_t ucs4)
boolisPrint(char32_t ucs4)
intdigitValue(char32_t ucs4)
char32_ttoLower(char32_t ucs4)
char32_ttoUpper(char32_t ucs4)
char32_ttoTitleCase(char32_t ucs4)
char32_ttoCaseFolded(char32_t ucs4)
boolisNonCharacter(char32_t ucs4)
boolisHighSurrogate(char32_t ucs4)
boolisLowSurrogate(char32_t ucs4)
boolisSurrogate(char32_t ucs4)
boolrequiresSurrogates(char32_t ucs4)
char32_tsurrogateToUcs4(char16_t high, char16_t low)
char32_tsurrogateToUcs4(QChar high, QChar low)
char16_thighSurrogate(char32_t ucs4)
char16_tlowSurrogate(char32_t ucs4)
QtPrivate::Ucs4CharsfromUcs4(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.

ConstantDescription
QChar::Mark_NonSpacingMn, a non-spacing combining mark.
QChar::Mark_SpacingCombiningMc, a spacing combining mark.
QChar::Mark_EnclosingMe, an enclosing mark.
QChar::Number_DecimalDigitNd, a decimal digit.
QChar::Number_LetterNl, a letter-like number, such as a Roman numeral.
QChar::Number_OtherNo, another number, such as a superscript digit.
QChar::Separator_SpaceZs, a space.
QChar::Separator_LineZl, the line separator.
QChar::Separator_ParagraphZp, the paragraph separator.
QChar::Other_ControlCc, a control character.
QChar::Other_FormatCf, a format character.
QChar::Other_SurrogateCs, a surrogate.
QChar::Other_PrivateUseCo, a private-use character.
QChar::Other_NotAssignedCn, a code point that is not assigned.
QChar::Letter_UppercaseLu, an uppercase letter.
QChar::Letter_LowercaseLl, a lowercase letter.
QChar::Letter_TitlecaseLt, a titlecase letter, such as U+01C5.
QChar::Letter_ModifierLm, a modifier letter.
QChar::Letter_OtherLo, another letter, such as an ideograph.
QChar::Punctuation_ConnectorPc, connector punctuation, such as the underscore.
QChar::Punctuation_DashPd, a dash.
QChar::Punctuation_OpenPs, opening punctuation, such as a parenthesis.
QChar::Punctuation_ClosePe, closing punctuation.
QChar::Punctuation_InitialQuotePi, an initial quotation mark.
QChar::Punctuation_FinalQuotePf, a final quotation mark.
QChar::Punctuation_OtherPo, other punctuation.
QChar::Symbol_MathSm, a mathematical symbol.
QChar::Symbol_CurrencySc, a currency symbol.
QChar::Symbol_ModifierSk, a modifier symbol.
QChar::Symbol_OtherSo, another symbol.

enum QChar::Decomposition

The kind of a character's decomposition mapping, from the tags of the Unicode Character Database.

ConstantDescription
QChar::NoDecompositionThe character has no decomposition.
QChar::CanonicalA canonical decomposition.
QChar::FontA font variant.
QChar::NoBreakA no-break version of a space or hyphen.
QChar::InitialAn initial presentation form (Arabic).
QChar::MedialA medial presentation form (Arabic).
QChar::FinalA final presentation form (Arabic).
QChar::IsolatedAn isolated presentation form (Arabic).
QChar::CircleAn encircled form.
QChar::SuperA superscript form.
QChar::SubA subscript form.
QChar::VerticalA vertical layout presentation form.
QChar::WideA wide (zenkaku) compatibility character.
QChar::NarrowA narrow (hankaku) compatibility character.
QChar::SmallA small variant form.
QChar::SquareA CJK squared font variant.
QChar::CompatAnother compatibility character.
QChar::FractionA vulgar fraction form.

enum QChar::Direction

The bidirectional class of a character, from the Unicode Character Database, used by the bidirectional algorithm (UAX #9).

ConstantDescription
QChar::DirLLeft-to-right.
QChar::DirRRight-to-left.
QChar::DirENEuropean number.
QChar::DirESEuropean number separator.
QChar::DirETEuropean number terminator.
QChar::DirANArabic number.
QChar::DirCSCommon number separator.
QChar::DirBParagraph separator.
QChar::DirSSegment separator, such as a tab.
QChar::DirWSWhitespace.
QChar::DirONOther neutral.
QChar::DirLRELeft-to-right embedding.
QChar::DirLROLeft-to-right override.
QChar::DirALRight-to-left Arabic letter.
QChar::DirRLERight-to-left embedding.
QChar::DirRLORight-to-left override.
QChar::DirPDFPop directional format.
QChar::DirNSMNonspacing mark.
QChar::DirBNBoundary neutral.
QChar::DirLRILeft-to-right isolate.
QChar::DirRLIRight-to-left isolate.
QChar::DirFSIFirst strong isolate.
QChar::DirPDIPop directional isolate.

enum QChar::JoiningType

How a character joins its neighbours in cursive scripts such as Arabic and Syriac (ArabicShaping.txt).

ConstantDescription
QChar::Joining_NoneThe character does not join.
QChar::Joining_CausingThe character causes joining, like U+200D ZERO WIDTH JOINER.
QChar::Joining_DualThe character joins on both sides.
QChar::Joining_RightThe character joins on its right side only.
QChar::Joining_LeftThe character joins on its left side only.
QChar::Joining_TransparentThe character does not affect joining, like most combining marks.

enum QChar::Script

The script of a character (Scripts.txt of the Unicode Character Database).

ConstantDescription
QChar::Script_UnknownUnassigned, private-use and other characters that belong to no script.
QChar::Script_InheritedCombining marks that take the script of the character they follow.
QChar::Script_CommonCharacters used by several scripts, such as punctuation, digits and symbols.
QChar::Script_AdlamAdlam.
QChar::Script_AhomAhom.
QChar::Script_AnatolianHieroglyphsAnatolian Hieroglyphs.
QChar::Script_ArabicArabic.
QChar::Script_ArmenianArmenian.
QChar::Script_AvestanAvestan.
QChar::Script_BalineseBalinese.
QChar::Script_BamumBamum.
QChar::Script_BassaVahBassa Vah.
QChar::Script_BatakBatak.
QChar::Script_BengaliBengali.
QChar::Script_BhaiksukiBhaiksuki.
QChar::Script_BopomofoBopomofo.
QChar::Script_BrahmiBrahmi.
QChar::Script_BrailleBraille.
QChar::Script_BugineseBuginese.
QChar::Script_BuhidBuhid.
QChar::Script_CanadianAboriginalCanadian Aboriginal.
QChar::Script_CarianCarian.
QChar::Script_CaucasianAlbanianCaucasian Albanian.
QChar::Script_ChakmaChakma.
QChar::Script_ChamCham.
QChar::Script_CherokeeCherokee.
QChar::Script_ChorasmianChorasmian.
QChar::Script_CopticCoptic.
QChar::Script_CuneiformCuneiform.
QChar::Script_CypriotCypriot.
QChar::Script_CyproMinoanCypro Minoan.
QChar::Script_CyrillicCyrillic.
QChar::Script_DeseretDeseret.
QChar::Script_DevanagariDevanagari.
QChar::Script_DivesAkuruDives Akuru.
QChar::Script_DograDogra.
QChar::Script_DuployanDuployan.
QChar::Script_EgyptianHieroglyphsEgyptian Hieroglyphs.
QChar::Script_ElbasanElbasan.
QChar::Script_ElymaicElymaic.
QChar::Script_EthiopicEthiopic.
QChar::Script_GarayGaray.
QChar::Script_GeorgianGeorgian.
QChar::Script_GlagoliticGlagolitic.
QChar::Script_GothicGothic.
QChar::Script_GranthaGrantha.
QChar::Script_GreekGreek.
QChar::Script_GujaratiGujarati.
QChar::Script_GunjalaGondiGunjala Gondi.
QChar::Script_GurmukhiGurmukhi.
QChar::Script_GurungKhemaGurung Khema.
QChar::Script_HanHan.
QChar::Script_HangulHangul.
QChar::Script_HanifiRohingyaHanifi Rohingya.
QChar::Script_HanunooHanunoo.
QChar::Script_HatranHatran.
QChar::Script_HebrewHebrew.
QChar::Script_HiraganaHiragana.
QChar::Script_ImperialAramaicImperial Aramaic.
QChar::Script_InscriptionalPahlaviInscriptional Pahlavi.
QChar::Script_InscriptionalParthianInscriptional Parthian.
QChar::Script_JavaneseJavanese.
QChar::Script_KaithiKaithi.
QChar::Script_KannadaKannada.
QChar::Script_KatakanaKatakana.
QChar::Script_KawiKawi.
QChar::Script_KayahLiKayah Li.
QChar::Script_KharoshthiKharoshthi.
QChar::Script_KhitanSmallScriptKhitan Small Script.
QChar::Script_KhmerKhmer.
QChar::Script_KhojkiKhojki.
QChar::Script_KhudawadiKhudawadi.
QChar::Script_KiratRaiKirat Rai.
QChar::Script_LaoLao.
QChar::Script_LatinLatin.
QChar::Script_LepchaLepcha.
QChar::Script_LimbuLimbu.
QChar::Script_LinearALinear A.
QChar::Script_LinearBLinear B.
QChar::Script_LisuLisu.
QChar::Script_LycianLycian.
QChar::Script_LydianLydian.
QChar::Script_MahajaniMahajani.
QChar::Script_MakasarMakasar.
QChar::Script_MalayalamMalayalam.
QChar::Script_MandaicMandaic.
QChar::Script_ManichaeanManichaean.
QChar::Script_MarchenMarchen.
QChar::Script_MasaramGondiMasaram Gondi.
QChar::Script_MedefaidrinMedefaidrin.
QChar::Script_MeeteiMayekMeetei Mayek.
QChar::Script_MendeKikakuiMende Kikakui.
QChar::Script_MeroiticCursiveMeroitic Cursive.
QChar::Script_MeroiticHieroglyphsMeroitic Hieroglyphs.
QChar::Script_MiaoMiao.
QChar::Script_ModiModi.
QChar::Script_MongolianMongolian.
QChar::Script_MroMro.
QChar::Script_MultaniMultani.
QChar::Script_MyanmarMyanmar.
QChar::Script_NabataeanNabataean.
QChar::Script_NagMundariNag Mundari.
QChar::Script_NandinagariNandinagari.
QChar::Script_NewTaiLueNew Tai Lue.
QChar::Script_NewaNewa.
QChar::Script_NkoNko.
QChar::Script_NushuNushu.
QChar::Script_NyiakengPuachueHmongNyiakeng Puachue Hmong.
QChar::Script_OghamOgham.
QChar::Script_OlChikiOl Chiki.
QChar::Script_OlOnalOl Onal.
QChar::Script_OldHungarianOld Hungarian.
QChar::Script_OldItalicOld Italic.
QChar::Script_OldNorthArabianOld North Arabian.
QChar::Script_OldPermicOld Permic.
QChar::Script_OldPersianOld Persian.
QChar::Script_OldSogdianOld Sogdian.
QChar::Script_OldSouthArabianOld South Arabian.
QChar::Script_OldTurkicOld Turkic.
QChar::Script_OldUyghurOld Uyghur.
QChar::Script_OriyaOriya.
QChar::Script_OsageOsage.
QChar::Script_OsmanyaOsmanya.
QChar::Script_PahawhHmongPahawh Hmong.
QChar::Script_PalmyrenePalmyrene.
QChar::Script_PauCinHauPau Cin Hau.
QChar::Script_PhagsPaPhags Pa.
QChar::Script_PhoenicianPhoenician.
QChar::Script_PsalterPahlaviPsalter Pahlavi.
QChar::Script_RejangRejang.
QChar::Script_RunicRunic.
QChar::Script_SamaritanSamaritan.
QChar::Script_SaurashtraSaurashtra.
QChar::Script_SharadaSharada.
QChar::Script_ShavianShavian.
QChar::Script_SiddhamSiddham.
QChar::Script_SignWritingSignWriting.
QChar::Script_SinhalaSinhala.
QChar::Script_SogdianSogdian.
QChar::Script_SoraSompengSora Sompeng.
QChar::Script_SoyomboSoyombo.
QChar::Script_SundaneseSundanese.
QChar::Script_SunuwarSunuwar.
QChar::Script_SylotiNagriSyloti Nagri.
QChar::Script_SyriacSyriac.
QChar::Script_TagalogTagalog.
QChar::Script_TagbanwaTagbanwa.
QChar::Script_TaiLeTai Le.
QChar::Script_TaiThamTai Tham.
QChar::Script_TaiVietTai Viet.
QChar::Script_TakriTakri.
QChar::Script_TamilTamil.
QChar::Script_TangsaTangsa.
QChar::Script_TangutTangut.
QChar::Script_TeluguTelugu.
QChar::Script_ThaanaThaana.
QChar::Script_ThaiThai.
QChar::Script_TibetanTibetan.
QChar::Script_TifinaghTifinagh.
QChar::Script_TirhutaTirhuta.
QChar::Script_TodhriTodhri.
QChar::Script_TotoToto.
QChar::Script_TuluTigalariTulu Tigalari.
QChar::Script_UgariticUgaritic.
QChar::Script_VaiVai.
QChar::Script_VithkuqiVithkuqi.
QChar::Script_WanchoWancho.
QChar::Script_WarangCitiWarang Citi.
QChar::Script_YezidiYezidi.
QChar::Script_YiYi.
QChar::Script_ZanabazarSquareZanabazar Square.
QChar::ScriptCountThe number of scripts; not a script.

enum QChar::SpecialCharacter

Names for commonly used code points.

ConstantDescription
QChar::NullU+0000, the null character.
QChar::TabulationU+0009, horizontal tabulation.
QChar::LineFeedU+000A, line feed.
QChar::CarriageReturnU+000D, carriage return.
QChar::SpaceU+0020, the space character.
QChar::NbspU+00A0, the no-break space.
QChar::SoftHyphenU+00AD, the soft hyphen.
QChar::ReplacementCharacterU+FFFD, used in place of invalid or unrepresentable input.
QChar::ObjectReplacementCharacterU+FFFC, the object replacement character.
QChar::ByteOrderMarkU+FEFF, the byte order mark.
QChar::ByteOrderSwappedU+FFFE, a byte order mark read with the wrong byte order.
QChar::ParagraphSeparatorU+2029, the paragraph separator.
QChar::LineSeparatorU+2028, the line separator.
QChar::VisualTabCharacterU+2192, the arrow some editors draw for a tab.
QChar::LastValidCodePointU+10FFFF, the last valid Unicode code point.

enum QChar::UnicodeVersion

The version of Unicode that assigned a character.

ConstantDescription
QChar::Unicode_UnassignedThe character is not assigned.
QChar::Unicode_1_1Version 1.1.
QChar::Unicode_2_0Version 2.0.
QChar::Unicode_2_1_2Version 2.1.2.
QChar::Unicode_3_0Version 3.0.
QChar::Unicode_3_1Version 3.1.
QChar::Unicode_3_2Version 3.2.
QChar::Unicode_4_0Version 4.0.
QChar::Unicode_4_1Version 4.1.
QChar::Unicode_5_0Version 5.0.
QChar::Unicode_5_1Version 5.1.
QChar::Unicode_5_2Version 5.2.
QChar::Unicode_6_0Version 6.0.
QChar::Unicode_6_1Version 6.1.
QChar::Unicode_6_2Version 6.2.
QChar::Unicode_6_3Version 6.3.
QChar::Unicode_7_0Version 7.0.
QChar::Unicode_8_0Version 8.0.
QChar::Unicode_9_0Version 9.0.
QChar::Unicode_10_0Version 10.0.
QChar::Unicode_11_0Version 11.0.
QChar::Unicode_12_0Version 12.0.
QChar::Unicode_12_1Version 12.1.
QChar::Unicode_13_0Version 13.0.
QChar::Unicode_14_0Version 14.0.
QChar::Unicode_15_0Version 15.0.
QChar::Unicode_15_1Version 15.1.
QChar::Unicode_16_0Version 16.0.

Member Function Documentation

[constexpr] QChar::QChar()

Constructs a null character (U+0000).

See also isNull().

[constexpr] QChar::QChar(char16_t c)

Constructs a character with the UTF-16 code unit c.

[constexpr] 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.

[constexpr] QChar::QChar(uchar c)

This is an overloaded function.

Constructs a character with the code unit c.

[constexpr] QChar::QChar(short c)

This is an overloaded function.

Constructs a character with the code unit c, reinterpreted as an unsigned 16-bit value.

[constexpr] QChar::QChar(ushort c)

This is an overloaded function.

Constructs a character with the code unit c.

[constexpr] QChar::QChar(int c)

This is an overloaded function.

Constructs a character from c, truncated to 16 bits.

[constexpr] QChar::QChar(uint c)

This is an overloaded function.

Constructs a character from c, truncated to 16 bits.

[constexpr] QChar::QChar(SpecialCharacter s)

This is an overloaded function.

Constructs a character with the code point of the special character s.

[constexpr] 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.

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

Returns the general category of the code point ucs4.

[constexpr] uchar QChar::cell() const

Returns the low byte of the code unit (the "cell" within its row).

See also row() and unicode().

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().

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

This is an overloaded function.

Returns the canonical combining class of ucs4.

[static] 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().

[static] 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().

[static] 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().

[static] 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().

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

This is an overloaded function.

Returns the bidirectional class of ucs4.

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

Converts the Latin-1 byte c to a QChar.

See also toLatin1().

[static, constexpr] 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().

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

This is an overloaded function.

Returns true if ucs4 is mirrored in right-to-left text.

[static, constexpr] 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().

[static] 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().

[static, constexpr] 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().

[static] 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().

[static] 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().

[static] 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().

[static, constexpr] 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.

[static] 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.

[static, constexpr] 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.

[constexpr] 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().

[static] 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.

[static] 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.

[static] 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.

[static] 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().

[static, constexpr] 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.

[static] 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().

[static] 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().

[static] 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.

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

This is an overloaded function.

Returns the joining type of ucs4.

[static, constexpr] 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().

[static] 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.

[static, constexpr] 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.

[constexpr] 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.

[static] 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.

[static, constexpr] char32_t QChar::surrogateToUcs4(char16_t high, char16_t low)

Returns the code point of the surrogate pair high and low.

[static, constexpr] 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().

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

This is an overloaded function.

Returns the simple case folding of ucs4.

[constexpr] 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().

[static] 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().

[static] 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().

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

This is an overloaded function.

Returns the simple uppercase mapping of ucs4.

[constexpr] char16_t QChar::unicode() const

Returns the UTF-16 code unit of this character.

See also cell() and row().

[constexpr] 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().

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

This is an overloaded function.

Returns the Unicode version that assigned ucs4.