Qt 4.8
Public Types | Public Functions | Static Public Functions | Properties | Related Functions | List of all members
QChar Class Reference

The QChar class provides a 16-bit Unicode character. More...

#include <qchar.h>

Public Types

enum  Category {
  NoCategory, Mark_NonSpacing, Mark_SpacingCombining, Mark_Enclosing,
  Number_DecimalDigit, Number_Letter, Number_Other, Separator_Space,
  Separator_Line, Separator_Paragraph, Other_Control, Other_Format,
  Other_Surrogate, Other_PrivateUse, Other_NotAssigned, Letter_Uppercase,
  Letter_Lowercase, Letter_Titlecase, Letter_Modifier, Letter_Other,
  Punctuation_Connector, Punctuation_Dash, Punctuation_Open, Punctuation_Close,
  Punctuation_InitialQuote, Punctuation_FinalQuote, Punctuation_Other, Symbol_Math,
  Symbol_Currency, Symbol_Modifier, Symbol_Other, Punctuation_Dask = Punctuation_Dash
}
 This enum maps the Unicode character categories. More...
 
enum  CombiningClass {
  Combining_BelowLeftAttached = 200, Combining_BelowAttached = 202, Combining_BelowRightAttached = 204, Combining_LeftAttached = 208,
  Combining_RightAttached = 210, Combining_AboveLeftAttached = 212, Combining_AboveAttached = 214, Combining_AboveRightAttached = 216,
  Combining_BelowLeft = 218, Combining_Below = 220, Combining_BelowRight = 222, Combining_Left = 224,
  Combining_Right = 226, Combining_AboveLeft = 228, Combining_Above = 230, Combining_AboveRight = 232,
  Combining_DoubleBelow = 233, Combining_DoubleAbove = 234, Combining_IotaSubscript = 240
}
 This enum type defines names for some of the Unicode combining classes. More...
 
enum  Decomposition {
  NoDecomposition, Canonical, Font, NoBreak,
  Initial, Medial, Final, Isolated,
  Circle, Super, Sub, Vertical,
  Wide, Narrow, Small, Square,
  Compat, Fraction
}
 This enum type defines the Unicode decomposition attributes. More...
 
enum  Direction {
  DirL, DirR, DirEN, DirES,
  DirET, DirAN, DirCS, DirB,
  DirS, DirWS, DirON, DirLRE,
  DirLRO, DirAL, DirRLE, DirRLO,
  DirPDF, DirNSM, DirBN
}
 This enum type defines the Unicode direction attributes. More...
 
enum  Joining { OtherJoining, Dual, Right, Center }
 This enum type defines the Unicode joining attributes. More...
 
enum  SpecialCharacter {
  Null = 0x0000, Nbsp = 0x00a0, ReplacementCharacter = 0xfffd, ObjectReplacementCharacter = 0xfffc,
  ByteOrderMark = 0xfeff, ByteOrderSwapped = 0xfffe, ParagraphSeparator = 0x2029, LineSeparator = 0x2028
}
 
enum  UnicodeVersion {
  Unicode_Unassigned, Unicode_1_1, Unicode_2_0, Unicode_2_1_2,
  Unicode_3_0, Unicode_3_1, Unicode_3_2, Unicode_4_0,
  Unicode_4_1, Unicode_5_0
}
 Specifies which version of the [Unicode standard](http://www. More...
 

Public Functions

Category category () const
 Returns the character's category. More...
 
uchar cell () const
 Returns the cell (least significant byte) of the Unicode character. More...
 
unsigned char combiningClass () const
 Returns the combining class for the character as defined in the Unicode standard. More...
 
QString decomposition () const
 Decomposes a character into its parts. More...
 
Decomposition decompositionTag () const
 Returns the tag defining the composition of the character. More...
 
int digitValue () const
 Returns the numeric value of the digit, or -1 if the character is not a digit. More...
 
Direction direction () const
 Returns the character's direction. More...
 
bool hasMirrored () const
 Returns true if the character should be reversed if the text direction is reversed; otherwise returns false. More...
 
bool isDigit () const
 Returns true if the character is a decimal digit (Number_DecimalDigit); otherwise returns false. More...
 
bool isHighSurrogate () const
 Returns true if the QChar is the high part of a utf16 surrogate (ie. More...
 
bool isLetter () const
 Returns true if the character is a letter (Letter_* categories); otherwise returns false. More...
 
bool isLetterOrNumber () const
 Returns true if the character is a letter or number (Letter_* or Number_* categories); otherwise returns false. More...
 
bool isLower () const
 Returns true if the character is a lowercase letter, i. More...
 
bool isLowSurrogate () const
 Returns true if the QChar is the low part of a utf16 surrogate (ie. More...
 
bool isMark () const
 Returns true if the character is a mark (Mark_* categories); otherwise returns false. More...
 
bool isNull () const
 Returns true if the character is the Unicode character 0x0000 ('\0'); otherwise returns false. More...
 
bool isNumber () const
 Returns true if the character is a number (Number_* categories, not just 0-9); otherwise returns false. More...
 
bool isPrint () const
 Returns true if the character is a printable character; otherwise returns false. More...
 
bool isPunct () const
 Returns true if the character is a punctuation mark (Punctuation_* categories); otherwise returns false. More...
 
bool isSpace () const
 Returns true if the character is a separator character (Separator_* categories); otherwise returns false. More...
 
bool isSymbol () const
 Returns true if the character is a symbol (Symbol_* categories); otherwise returns false. More...
 
bool isTitleCase () const
 Returns true if the character is a titlecase letter, i. More...
 
bool isUpper () const
 Returns true if the character is an uppercase letter, i. More...
 
Joining joining () const
 Returns information about the joining properties of the character (needed for certain languages such as Arabic). More...
 
QChar mirroredChar () const
 Returns the mirrored character if this character is a mirrored character; otherwise returns the character itself. More...
 
 QChar ()
 Constructs a null QChar ('\0'). More...
 
QT_ASCII_CAST_WARN_CONSTRUCTOR QChar (char c)
 Constructs a QChar corresponding to ASCII/Latin-1 character ch. More...
 
QT_ASCII_CAST_WARN_CONSTRUCTOR QChar (uchar c)
 Constructs a QChar corresponding to ASCII/Latin-1 character ch. More...
 
 QChar (QLatin1Char ch)
 Constructs a QChar corresponding to ASCII/Latin-1 character ch. More...
 
 QChar (uchar c, uchar r)
 Constructs a QChar for Unicode cell cell in row row. More...
 
 QChar (ushort rc)
 Constructs a QChar for the character with Unicode code point code. More...
 
 QChar (short rc)
 Constructs a QChar for the character with Unicode code point code. More...
 
 QChar (uint rc)
 Constructs a QChar for the character with Unicode code point code. More...
 
 QChar (int rc)
 Constructs a QChar for the character with Unicode code point code. More...
 
 QChar (SpecialCharacter sc)
 Constructs a QChar for the predefined character value ch. More...
 
uchar row () const
 Returns the row (most significant byte) of the Unicode character. More...
 
void setCell (uchar cell)
 
void setRow (uchar row)
 
char toAscii () const
 Returns the character value of the QChar obtained using the current codec used to read C strings, or 0 if the character is not representable using this codec. More...
 
QChar toCaseFolded () const
 Returns the case folded equivalent of the character. More...
 
char toLatin1 () const
 Returns the Latin-1 character equivalent to the QChar, or 0. More...
 
QChar toLower () const
 Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the character itself. More...
 
QChar toTitleCase () const
 Returns the title case equivalent if the character is lowercase or uppercase; otherwise returns the character itself. More...
 
QChar toUpper () const
 Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the character itself. More...
 
ushort unicode () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
ushortunicode ()
 Returns a reference to the numeric Unicode value of the QChar. More...
 
UnicodeVersion unicodeVersion () const
 Returns the Unicode version that introduced this character. More...
 

Static Public Functions

static Category QT_FASTCALL category (uint ucs4)
 Returns the category of the UCS-4-encoded character specified by ucs4. More...
 
static Category QT_FASTCALL category (ushort ucs2)
 Returns the category of the UCS-2-encoded character specified by ucs2. More...
 
static unsigned char QT_FASTCALL combiningClass (uint ucs4)
 Returns the combining class for the UCS-4-encoded character specified by ucs4, as defined in the Unicode standard. More...
 
static unsigned char QT_FASTCALL combiningClass (ushort ucs2)
 Returns the combining class for the UCS-2-encoded character specified by ucs2, as defined in the Unicode standard. More...
 
static UnicodeVersion QT_FASTCALL currentUnicodeVersion ()
 Returns the most recent supported Unicode version. More...
 
static QString QT_FASTCALL decomposition (uint ucs4)
 Decomposes the UCS-4-encoded character specified by ucs4 into its constituent parts. More...
 
static Decomposition QT_FASTCALL decompositionTag (uint ucs4)
 Returns the tag defining the composition of the UCS-4-encoded character specified by ucs4. More...
 
static int QT_FASTCALL digitValue (uint ucs4)
 Returns the numeric value of the digit specified by the UCS-4-encoded character, ucs4, or -1 if the character is not a digit. More...
 
static int QT_FASTCALL digitValue (ushort ucs2)
 Returns the numeric value of the digit, specified by the UCS-2-encoded character, ucs2, or -1 if the character is not a digit. More...
 
static Direction QT_FASTCALL direction (uint ucs4)
 Returns the direction of the UCS-4-encoded character specified by ucs4. More...
 
static Direction QT_FASTCALL direction (ushort ucs2)
 Returns the direction of the UCS-2-encoded character specified by ucs2. More...
 
static QChar fromAscii (char c)
 Converts the ASCII character c to its equivalent QChar. More...
 
static QChar fromLatin1 (char c)
 Converts the Latin-1 character c to its equivalent QChar. More...
 
static ushort highSurrogate (uint ucs4)
 Returns the high surrogate value of a ucs4 code point. More...
 
static bool isHighSurrogate (uint ucs4)
 Returns true if the UCS-4-encoded character specified by ucs4 is the high part of a utf16 surrogate (ie. More...
 
static bool isLowSurrogate (uint ucs4)
 Returns true if the UCS-4-encoded character specified by ucs4 is the low part of a utf16 surrogate (ie. More...
 
static Joining QT_FASTCALL joining (uint ucs4)
 Returns information about the joining properties of the UCS-4-encoded character specified by ucs4 (needed for certain languages such as Arabic). More...
 
static Joining QT_FASTCALL joining (ushort ucs2)
 Returns information about the joining properties of the UCS-2-encoded character specified by ucs2 (needed for certain languages such as Arabic). More...
 
static ushort lowSurrogate (uint ucs4)
 Returns the low surrogate value of a ucs4 code point. More...
 
static uint QT_FASTCALL 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. More...
 
static ushort QT_FASTCALL mirroredChar (ushort ucs2)
 Returns the mirrored character if the UCS-2-encoded character specified by ucs2 is a mirrored character; otherwise returns the character itself. More...
 
static bool requiresSurrogates (uint ucs4)
 Returns true if the UCS-4-encoded character specified by ucs4 can be split into the high and low parts of a utf16 surrogate (ie. More...
 
static uint surrogateToUcs4 (ushort high, ushort low)
 Converts a UTF16 surrogate pair with the given high and low values to its UCS-4 code point. More...
 
static uint surrogateToUcs4 (QChar high, QChar low)
 Converts a utf16 surrogate pair (high, low) to its ucs4 code point. More...
 
static uint QT_FASTCALL toCaseFolded (uint ucs4)
 Returns the case folded equivalent of the UCS-4-encoded character specified by ucs4. More...
 
static ushort QT_FASTCALL toCaseFolded (ushort ucs2)
 Returns the case folded equivalent of the UCS-2-encoded character specified by ucs2. More...
 
static uint QT_FASTCALL 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. More...
 
static ushort QT_FASTCALL toLower (ushort ucs2)
 Returns the lowercase equivalent of the UCS-2-encoded character specified by ucs2 if the character is uppercase or titlecase; otherwise returns the character itself. More...
 
static uint QT_FASTCALL 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. More...
 
static ushort QT_FASTCALL toTitleCase (ushort ucs2)
 Returns the title case equivalent of the UCS-2-encoded character specified by ucs2 if the character is lowercase or uppercase; otherwise returns the character itself. More...
 
static uint QT_FASTCALL toUpper (uint ucs4)
 Returns the uppercase equivalent of the UCS-4-encoded character specified by ucs4 if the character is lowercase or titlecase; otherwise returns the character itself. More...
 
static ushort QT_FASTCALL toUpper (ushort ucs2)
 Returns the uppercase equivalent of the UCS-2-encoded character specified by ucs2 if the character is lowercase or titlecase; otherwise returns the character itself. More...
 
static UnicodeVersion QT_FASTCALL unicodeVersion (uint ucs4)
 Returns the Unicode version that introduced the character specified in its UCS-4-encoded form as ucs4. More...
 
static UnicodeVersion QT_FASTCALL unicodeVersion (ushort ucs2)
 Returns the Unicode version that introduced the character specified in its UCS-2-encoded form as ucs2. More...
 

Properties

ushort ucs
 

Related Functions

(Note that these are not member functions.)

int operator!= (QChar c1, QChar c2)
 Returns true if c1 and c2 are not the same Unicode character; otherwise returns false. More...
 
int operator< (QChar c1, QChar c2)
 Returns true if the numeric Unicode value of c1 is less than that of c2; otherwise returns false. More...
 
QDataStreamoperator<< (QDataStream &out, const QChar &chr)
 Writes the char chr to the stream out. More...
 
int operator<= (QChar c1, QChar c2)
 Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false. More...
 
bool operator== (QChar c1, QChar c2)
 Returns true if c1 and c2 are the same Unicode character; otherwise returns false. More...
 
int operator> (QChar c1, QChar c2)
 Returns true if the numeric Unicode value of c1 is greater than that of c2; otherwise returns false. More...
 
int operator>= (QChar c1, QChar c2)
 Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false. More...
 
QDataStreamoperator>> (QDataStream &in, QChar &chr)
 Reads a char from the stream in into char chr. More...
 

Detailed Description

The QChar class provides a 16-bit Unicode character.

Note
This class or function is reentrant.

In Qt, Unicode characters are 16-bit entities without any markup or structure. This class represents such an entity. It is lightweight, so it can be used everywhere. Most compilers treat it like a unsigned short.

QChar provides a full complement of testing/classification functions, converting to and from other formats, converting from composed to decomposed Unicode, and trying to compare and case-convert if you ask it to.

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. They all return true if the character is a certain type of character; otherwise they return false. These classification functions are isNull() (returns true if the character is '\0'), isPrint() (true if the character is any sort of printable character, including whitespace), isPunct() (any sort of punctation), isMark() (Unicode Mark), isLetter() (a letter), isNumber() (any sort of numeric character, not just 0-9), isLetterOrNumber(), and isDigit() (decimal digits). All of these are wrappers around category() which return the Unicode-defined category of each character.

QChar also provides direction(), which indicates the "natural" writing direction of this character. The joining() function indicates how the character joins with its neighbors (needed mostly for Arabic) and finally hasMirrored(), which indicates whether the character needs to be mirrored when it is printed in its "unnatural" writing direction.

Composed Unicode characters (like ) can be converted to decomposed Unicode ("a" followed by "ring above") by using 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() and toLower() will do case changes when the character has a well-defined uppercase/lowercase equivalent. For locale-dependent comparisons, use QString::localeAwareCompare().

The conversion functions include unicode() (to a scalar), toLatin1() (to scalar, but converts all non-Latin-1 characters to 0), row() (gives the Unicode row), cell() (gives the Unicode cell), digitValue() (gives the integer value of any of the numerous digit characters), and a host of constructors.

QChar provides constructors and cast operators that make it easy to convert to and from traditional 8-bit chars. If you defined QT_NO_CAST_FROM_ASCII and QT_NO_CAST_TO_ASCII, as explained in the QString documentation, you will need to explicitly call fromAscii() or fromLatin1(), or use QLatin1Char, to construct a QChar from an 8-bit char, and you will need to call toAscii() or toLatin1() to get the 8-bit value back.

See also
QString, Unicode, QLatin1Char

Definition at line 72 of file qchar.h.

Enumerations

◆ Category

This enum maps the Unicode character categories.

The following characters are normative in Unicode:

  • Mark_NonSpacing Unicode class name Mn
  • Mark_SpacingCombining Unicode class name Mc
  • Mark_Enclosing Unicode class name Me
  • Number_DecimalDigit Unicode class name Nd
  • Number_Letter Unicode class name Nl
  • Number_Other Unicode class name No
  • Separator_Space Unicode class name Zs
  • Separator_Line Unicode class name Zl
  • Separator_Paragraph Unicode class name Zp
  • Other_Control Unicode class name Cc
  • Other_Format Unicode class name Cf
  • Other_Surrogate Unicode class name Cs
  • Other_PrivateUse Unicode class name Co
  • Other_NotAssigned Unicode class name Cn

The following categories are informative in Unicode:

  • Letter_Uppercase Unicode class name Lu
  • Letter_Lowercase Unicode class name Ll
  • Letter_Titlecase Unicode class name Lt
  • Letter_Modifier Unicode class name Lm
  • Letter_Other Unicode class name Lo
  • Punctuation_Connector Unicode class name Pc
  • Punctuation_Dash Unicode class name Pd
  • Punctuation_Open Unicode class name Ps
  • Punctuation_Close Unicode class name Pe
  • Punctuation_InitialQuote Unicode class name Pi
  • Punctuation_FinalQuote Unicode class name Pf
  • Punctuation_Other Unicode class name Po
  • Symbol_Math Unicode class name Sm
  • Symbol_Currency Unicode class name Sc
  • Symbol_Modifier Unicode class name Sk
  • Symbol_Other Unicode class name So
  • NoCategory Qt cannot find an appropriate category for the character.
  • Punctuation_Dask
See also
category()
Enumerator
NoCategory 
Mark_NonSpacing 
Mark_SpacingCombining 
Mark_Enclosing 
Number_DecimalDigit 
Number_Letter 
Number_Other 
Separator_Space 
Separator_Line 
Separator_Paragraph 
Other_Control 
Other_Format 
Other_Surrogate 
Other_PrivateUse 
Other_NotAssigned 
Letter_Uppercase 
Letter_Lowercase 
Letter_Titlecase 
Letter_Modifier 
Letter_Other 
Punctuation_Connector 
Punctuation_Dash 
Punctuation_Open 
Punctuation_Close 
Punctuation_InitialQuote 
Punctuation_FinalQuote 
Punctuation_Other 
Symbol_Math 
Symbol_Currency 
Symbol_Modifier 
Symbol_Other 
Punctuation_Dask 

Definition at line 106 of file qchar.h.

107  {
108  NoCategory, // ### Qt 5: replace with Other_NotAssigned
109 
110  Mark_NonSpacing, // Mn
111  Mark_SpacingCombining, // Mc
112  Mark_Enclosing, // Me
113 
114  Number_DecimalDigit, // Nd
115  Number_Letter, // Nl
116  Number_Other, // No
117 
118  Separator_Space, // Zs
119  Separator_Line, // Zl
120  Separator_Paragraph, // Zp
121 
122  Other_Control, // Cc
123  Other_Format, // Cf
124  Other_Surrogate, // Cs
125  Other_PrivateUse, // Co
126  Other_NotAssigned, // Cn
127 
128  Letter_Uppercase, // Lu
129  Letter_Lowercase, // Ll
130  Letter_Titlecase, // Lt
131  Letter_Modifier, // Lm
132  Letter_Other, // Lo
133 
134  Punctuation_Connector, // Pc
135  Punctuation_Dash, // Pd
136  Punctuation_Open, // Ps
137  Punctuation_Close, // Pe
140  Punctuation_Other, // Po
141 
142  Symbol_Math, // Sm
143  Symbol_Currency, // Sc
144  Symbol_Modifier, // Sk
145  Symbol_Other, // So
146 
147  Punctuation_Dask = Punctuation_Dash // ### Qt 5: remove
148  };

◆ CombiningClass

This enum type defines names for some of the Unicode combining classes.

Warning
This function is not part of the public interface.

See the Unicode Standard for a description of the values.

  • Combining_Above
  • Combining_AboveAttached
  • Combining_AboveLeft
  • Combining_AboveLeftAttached
  • Combining_AboveRight
  • Combining_AboveRightAttached
  • Combining_Below
  • Combining_BelowAttached
  • Combining_BelowLeft
  • Combining_BelowLeftAttached
  • Combining_BelowRight
  • Combining_BelowRightAttached
  • Combining_DoubleAbove
  • Combining_DoubleBelow
  • Combining_IotaSubscript
  • Combining_Left
  • Combining_LeftAttached
  • Combining_Right
  • Combining_RightAttached
Enumerator
Combining_BelowLeftAttached 
Combining_BelowAttached 
Combining_BelowRightAttached 
Combining_LeftAttached 
Combining_RightAttached 
Combining_AboveLeftAttached 
Combining_AboveAttached 
Combining_AboveRightAttached 
Combining_BelowLeft 
Combining_Below 
Combining_BelowRight 
Combining_Left 
Combining_Right 
Combining_AboveLeft 
Combining_Above 
Combining_AboveRight 
Combining_DoubleBelow 
Combining_DoubleAbove 
Combining_IotaSubscript 

Definition at line 187 of file qchar.h.

188  {
197 
198  Combining_BelowLeft = 218,
199  Combining_Below = 220,
200  Combining_BelowRight = 222,
201  Combining_Left = 224,
202  Combining_Right = 226,
203  Combining_AboveLeft = 228,
204  Combining_Above = 230,
205  Combining_AboveRight = 232,
206 
207  Combining_DoubleBelow = 233,
208  Combining_DoubleAbove = 234,
210  };

◆ Decomposition

This enum type defines the Unicode decomposition attributes.

See the Unicode Standard for a description of the values.

  • NoDecomposition
  • Canonical
  • Circle
  • Compat
  • Final
  • Font
  • Fraction
  • Initial
  • Isolated
  • Medial
  • Narrow
  • NoBreak
  • Small
  • Square
  • Sub
  • Super
  • Vertical
  • Wide
  • Single
See also
decomposition()
Enumerator
NoDecomposition 
Canonical 
Font 
NoBreak 
Initial 
Medial 
Final 
Isolated 
Circle 
Super 
Sub 
Vertical 
Wide 
Narrow 
Small 
Square 
Compat 
Fraction 

Definition at line 156 of file qchar.h.

157  {
159  Canonical,
160  Font,
161  NoBreak,
162  Initial,
163  Medial,
164  Final,
165  Isolated,
166  Circle,
167  Super,
168  Sub,
169  Vertical,
170  Wide,
171  Narrow,
172  Small,
173  Square,
174  Compat,
175  Fraction
176 
177 #ifdef QT3_SUPPORT
178  , Single = NoDecomposition
179 #endif
180  };

◆ Direction

This enum type defines the Unicode direction attributes.

See the Unicode Standard for a description of the values.

In order to conform to C/C++ naming conventions "Dir" is prepended to the codes used in the Unicode Standard.

  • DirAL
  • DirAN
  • DirB
  • DirBN
  • DirCS
  • DirEN
  • DirES
  • DirET
  • DirL
  • DirLRE
  • DirLRO
  • DirNSM
  • DirON
  • DirPDF
  • DirR
  • DirRLE
  • DirRLO
  • DirS
  • DirWS
See also
direction()
Enumerator
DirL 
DirR 
DirEN 
DirES 
DirET 
DirAN 
DirCS 
DirB 
DirS 
DirWS 
DirON 
DirLRE 
DirLRO 
DirAL 
DirRLE 
DirRLO 
DirPDF 
DirNSM 
DirBN 

Definition at line 150 of file qchar.h.

◆ Joining

This enum type defines the Unicode joining attributes.

See the Unicode Standard for a description of the values.

  • Center
  • Dual
  • OtherJoining
  • Right
See also
joining()
Enumerator
OtherJoining 
Dual 
Right 
Center 

Definition at line 182 of file qchar.h.

◆ SpecialCharacter

  • Null A QChar with this value isNull().
  • Nbsp Non-breaking space.
  • ReplacementCharacter 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.
  • ObjectReplacementCharacter Used to represent an object such as an image when such objects cannot be presented.
  • ByteOrderMark
  • ByteOrderSwapped
  • ParagraphSeparator
  • LineSeparator
  • null
  • replacement
  • byteOrderMark
  • byteOrderSwapped
  • nbsp
Enumerator
Null 
Nbsp 
ReplacementCharacter 
ObjectReplacementCharacter 
ByteOrderMark 
ByteOrderSwapped 
ParagraphSeparator 
LineSeparator 

Definition at line 85 of file qchar.h.

85  {
86  Null = 0x0000,
87  Nbsp = 0x00a0,
88  ReplacementCharacter = 0xfffd,
90  ByteOrderMark = 0xfeff,
91  ByteOrderSwapped = 0xfffe,
92 #ifdef QT3_SUPPORT
93  null = Null,
94  replacement = ReplacementCharacter,
95  byteOrderMark = ByteOrderMark,
96  byteOrderSwapped = ByteOrderSwapped,
97  nbsp = Nbsp,
98 #endif
99  ParagraphSeparator = 0x2029,
100  LineSeparator = 0x2028
101  };

◆ UnicodeVersion

Specifies which version of the [Unicode standard](http://www.

unicode.org/) introduced a certain character.

  • Unicode_1_1 Version 1.1
  • Unicode_2_0 Version 2.0
  • Unicode_2_1_2 Version 2.1.2
  • Unicode_3_0 Version 3.0
  • Unicode_3_1 Version 3.1
  • Unicode_3_2 Version 3.2
  • Unicode_4_0 Version 4.0
  • Unicode_4_1 Version 4.1
  • Unicode_5_0 Version 5.0
  • Unicode_Unassigned The value is not assigned to any character in version 5.0 of Unicode.
See also
unicodeVersion()
Enumerator
Unicode_Unassigned 
Unicode_1_1 
Unicode_2_0 
Unicode_2_1_2 
Unicode_3_0 
Unicode_3_1 
Unicode_3_2 
Unicode_4_0 
Unicode_4_1 
Unicode_5_0 

Definition at line 212 of file qchar.h.

Constructors and Destructors

◆ QChar() [1/10]

QChar::QChar ( )
inline

Constructs a null QChar ('\0').

See also
isNull()

Definition at line 371 of file qchar.h.

Referenced by canonicalOrderHelper(), composeHelper(), decomposeHelper(), foldCase(), fromAscii(), and fromLatin1().

371 : ucs(0) {}
ushort ucs
Definition: qchar.h:362

◆ QChar() [2/10]

QChar::QChar ( char  c)

Constructs a QChar corresponding to ASCII/Latin-1 character ch.

Definition at line 477 of file qchar.cpp.

478 {
479 #ifndef QT_NO_CODEC_FOR_C_STRINGS
481  // #####
483  else
484 #endif
485  ucs = uchar(ch);
486 }
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
ushort ucs
Definition: qchar.h:362
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
static QTextCodec * codecForCStrings()
Returns the codec used by QString to convert to and from const char * and QByteArrays.
Definition: qtextcodec.h:157
unsigned char uchar
Definition: qglobal.h:994
QString toUnicode(const QByteArray &) const
Converts a from the encoding of this codec to Unicode, and returns the result in a QString...

◆ QChar() [3/10]

QChar::QChar ( uchar  c)

Constructs a QChar corresponding to ASCII/Latin-1 character ch.

Definition at line 491 of file qchar.cpp.

492 {
493 #ifndef QT_NO_CODEC_FOR_C_STRINGS
495  // #####
496  char c = char(ch);
498  } else
499 #endif
500  ucs = ch;
501 }
unsigned char c[8]
Definition: qnumeric_p.h:62
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
ushort ucs
Definition: qchar.h:362
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
static QTextCodec * codecForCStrings()
Returns the codec used by QString to convert to and from const char * and QByteArrays.
Definition: qtextcodec.h:157
QString toUnicode(const QByteArray &) const
Converts a from the encoding of this codec to Unicode, and returns the result in a QString...

◆ QChar() [4/10]

QChar::QChar ( QLatin1Char  ch)
inline

Constructs a QChar corresponding to ASCII/Latin-1 character ch.

Definition at line 385 of file qchar.h.

385 : ucs(ch.unicode()) {}
ushort ucs
Definition: qchar.h:362
ushort unicode() const
Converts a Latin-1 character to an 16-bit-encoded Unicode representation of the character.
Definition: qchar.h:64

◆ QChar() [5/10]

QChar::QChar ( uchar  cell,
uchar  row 
)
inline

Constructs a QChar for Unicode cell cell in row row.

See also
cell(), row()

Definition at line 380 of file qchar.h.

380 : ucs(ushort((r << 8) | c)){}
unsigned char c[8]
Definition: qnumeric_p.h:62
ushort ucs
Definition: qchar.h:362
unsigned short ushort
Definition: qglobal.h:995

◆ QChar() [6/10]

QChar::QChar ( ushort  rc)
inline

Constructs a QChar for the character with Unicode code point code.

Definition at line 81 of file qchar.h.

81 : ucs(rc){}
ushort ucs
Definition: qchar.h:362

◆ QChar() [7/10]

QChar::QChar ( short  rc)
inline

Constructs a QChar for the character with Unicode code point code.

Definition at line 381 of file qchar.h.

381 : ucs(ushort(rc)){}
ushort ucs
Definition: qchar.h:362
unsigned short ushort
Definition: qglobal.h:995

◆ QChar() [8/10]

QChar::QChar ( uint  rc)
inline

Constructs a QChar for the character with Unicode code point code.

Definition at line 382 of file qchar.h.

382 : ucs(ushort(rc & 0xffff)){}
ushort ucs
Definition: qchar.h:362
unsigned short ushort
Definition: qglobal.h:995

◆ QChar() [9/10]

QChar::QChar ( int  rc)
inline

Constructs a QChar for the character with Unicode code point code.

Definition at line 383 of file qchar.h.

383 : ucs(ushort(rc & 0xffff)){}
ushort ucs
Definition: qchar.h:362
unsigned short ushort
Definition: qglobal.h:995

◆ QChar() [10/10]

QChar::QChar ( SpecialCharacter  sc)
inline

Constructs a QChar for the predefined character value ch.

Definition at line 384 of file qchar.h.

384 : ucs(ushort(s)) {}
ushort ucs
Definition: qchar.h:362
unsigned short ushort
Definition: qglobal.h:995

Functions

◆ category() [1/3]

QChar::Category QChar::category ( ) const

◆ category() [2/3]

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

Returns the category of the UCS-4-encoded character specified by ucs4.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
4.3

Definition at line 866 of file qchar.cpp.

867 {
868  if (ucs4 > UNICODE_LAST_CODEPOINT)
869  return QChar::NoCategory;
870  return (QChar::Category) qGetProp(ucs4)->category;
871 }
Category
This enum maps the Unicode character categories.
Definition: qchar.h:106
#define UNICODE_LAST_CODEPOINT
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ category() [3/3]

QChar::Category QChar::category ( ushort  ucs2)
static

Returns the category of the UCS-2-encoded character specified by ucs2.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 880 of file qchar.cpp.

881 {
882  return (QChar::Category) qGetProp(ucs2)->category;
883 }
Category
This enum maps the Unicode character categories.
Definition: qchar.h:106
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ cell()

uchar QChar::cell ( ) const
inline

◆ combiningClass() [1/3]

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.

Definition at line 1153 of file qchar.cpp.

Referenced by QCharRef::combiningClass(), and HB_GetUnicodeCharCombiningClass().

1154 {
1155  return (unsigned char) qGetProp(ucs)->combiningClass;
1156 }
ushort ucs
Definition: qchar.h:362
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ combiningClass() [2/3]

unsigned char QChar::combiningClass ( uint  ucs4)
static

Returns the combining class for the UCS-4-encoded character specified by ucs4, as defined in the Unicode standard.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1166 of file qchar.cpp.

1167 {
1168  if (ucs4 > UNICODE_LAST_CODEPOINT)
1169  return 0;
1170  return (unsigned char) qGetProp(ucs4)->combiningClass;
1171 }
#define UNICODE_LAST_CODEPOINT
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ combiningClass() [3/3]

unsigned char QChar::combiningClass ( ushort  ucs2)
static

Returns the combining class for the UCS-2-encoded character specified by ucs2, as defined in the Unicode standard.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1181 of file qchar.cpp.

1182 {
1183  return (unsigned char) qGetProp(ucs2)->combiningClass;
1184 }
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ currentUnicodeVersion()

QChar::UnicodeVersion QChar::currentUnicodeVersion ( )
static

Returns the most recent supported Unicode version.

Since
4.8

Definition at line 1230 of file qchar.cpp.

1231 {
1232  return UNICODE_DATA_VERSION;
1233 }
#define UNICODE_DATA_VERSION

◆ decomposition() [1/2]

QString QChar::decomposition ( ) const

Decomposes a character into its parts.

Returns an empty string if no decomposition exists.

Definition at line 1096 of file qchar.cpp.

Referenced by QCharRef::decomposition(), and decompositionHelper().

1097 {
1098  return decomposition(ucs);
1099 }
ushort ucs
Definition: qchar.h:362
QString decomposition() const
Decomposes a character into its parts.
Definition: qchar.cpp:1096

◆ decomposition() [2/2]

QString QChar::decomposition ( uint  ucs4)
static

Decomposes the UCS-4-encoded character specified by ucs4 into its constituent parts.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns an empty string if no decomposition exists.

Definition at line 1109 of file qchar.cpp.

1110 {
1111  unsigned short buffer[3];
1112  int length;
1113  int tag;
1114  const unsigned short *d = decompositionHelper(ucs4, &length, &tag, buffer);
1115  return QString::fromUtf16(d, length);
1116 }
double d
Definition: qnumeric_p.h:62
static QString fromUtf16(const ushort *, int size=-1)
Returns a QString initialized with the first size characters of the Unicode string unicode (ISO-10646...
Definition: qstring.cpp:4329
static const unsigned short *QT_FASTCALL decompositionHelper(uint ucs4, int *length, int *tag, unsigned short *buffer)
Definition: qchar.cpp:1068

◆ decompositionTag() [1/2]

QChar::Decomposition QChar::decompositionTag ( ) const

Returns the tag defining the composition of the character.

Returns QChar::Single if no decomposition exists.

Definition at line 1122 of file qchar.cpp.

Referenced by QCharRef::decompositionTag().

1123 {
1124  return decompositionTag(ucs);
1125 }
ushort ucs
Definition: qchar.h:362
Decomposition decompositionTag() const
Returns the tag defining the composition of the character.
Definition: qchar.cpp:1122

◆ decompositionTag() [2/2]

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

Returns the tag defining the composition of the UCS-4-encoded character specified by ucs4.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns QChar::Single if no decomposition exists.

Definition at line 1135 of file qchar.cpp.

1136 {
1137  if (ucs4 > UNICODE_LAST_CODEPOINT)
1138  return QChar::NoDecomposition;
1139  const unsigned short index = GET_DECOMPOSITION_INDEX(ucs4);
1140  if (index == 0xffff)
1141  return QChar::NoDecomposition;
1143 }
#define GET_DECOMPOSITION_INDEX(ucs4)
#define UNICODE_LAST_CODEPOINT
quint16 index
static const unsigned short uc_decomposition_map[]
Decomposition
This enum type defines the Unicode decomposition attributes.
Definition: qchar.h:156

◆ digitValue() [1/3]

int QChar::digitValue ( ) const

Returns the numeric value of the digit, or -1 if the character is not a digit.

Definition at line 817 of file qchar.cpp.

Referenced by QCharRef::digitValue(), findArgEscapes(), QTextStreamPrivate::getNumber(), QLineControl::isValidInput(), QFileSystemModelPrivate::naturalCompare(), qt_mac_get_key(), QString::replace(), and replaceArgEscapes().

818 {
819  return qGetProp(ucs)->digitValue;
820 }
ushort ucs
Definition: qchar.h:362
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ digitValue() [2/3]

int QChar::digitValue ( uint  ucs4)
static

Returns the numeric value of the digit specified by the UCS-4-encoded character, ucs4, or -1 if the character is not a digit.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 843 of file qchar.cpp.

844 {
845  if (ucs4 > UNICODE_LAST_CODEPOINT)
846  return 0;
847  return qGetProp(ucs4)->digitValue;
848 }
#define UNICODE_LAST_CODEPOINT
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ digitValue() [3/3]

int QChar::digitValue ( ushort  ucs2)
static

Returns the numeric value of the digit, specified by the UCS-2-encoded character, ucs2, or -1 if the character is not a digit.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 830 of file qchar.cpp.

831 {
832  return qGetProp(ucs2)->digitValue;
833 }
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ direction() [1/3]

QChar::Direction QChar::direction ( ) const

Returns the character's direction.

Definition at line 889 of file qchar.cpp.

Referenced by bidiItemize(), QCharRef::direction(), isStringRightToLeft(), skipBoundryNeutrals(), and QTextBlock::textDirection().

890 {
892 }
ushort ucs
Definition: qchar.h:362
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
Direction
This enum type defines the Unicode direction attributes.
Definition: qchar.h:150

◆ direction() [2/3]

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

Returns the direction of the UCS-4-encoded character specified by ucs4.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 901 of file qchar.cpp.

902 {
903  if (ucs4 > UNICODE_LAST_CODEPOINT)
904  return QChar::DirL;
905  return (QChar::Direction) qGetProp(ucs4)->direction;
906 }
#define UNICODE_LAST_CODEPOINT
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
Direction
This enum type defines the Unicode direction attributes.
Definition: qchar.h:150

◆ direction() [3/3]

QChar::Direction QChar::direction ( ushort  ucs2)
static

Returns the direction of the UCS-2-encoded character specified by ucs2.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 915 of file qchar.cpp.

916 {
917  return (QChar::Direction) qGetProp(ucs2)->direction;
918 }
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
Direction
This enum type defines the Unicode direction attributes.
Definition: qchar.h:150

◆ fromAscii()

QChar QChar::fromAscii ( char  c)
static

Converts the ASCII character c to its equivalent QChar.

This is mainly useful for non-internationalized software.

An alternative is to use QLatin1Char.

See also
fromLatin1(), unicode(), QTextCodec::codecForCStrings()

Definition at line 1521 of file qchar.cpp.

Referenced by convert(), QAbstractConcatenable::convertFromAscii(), QString::isNull(), operator+(), QString::operator+=(), QTextStream::operator<<(), QString::operator=(), QCharRef::operator=(), and QHttpNetworkConnectionPrivate::prepareRequest().

1522 {
1523 #ifndef QT_NO_CODEC_FOR_C_STRINGS
1525  // #####
1526  return QTextCodec::codecForCStrings()->toUnicode(&c, 1).at(0).unicode();
1527 #endif
1528  return QChar(ushort((uchar)c));
1529 }
unsigned char c[8]
Definition: qnumeric_p.h:62
QChar()
Constructs a null QChar (&#39;\0&#39;).
Definition: qchar.h:371
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
static QTextCodec * codecForCStrings()
Returns the codec used by QString to convert to and from const char * and QByteArrays.
Definition: qtextcodec.h:157
unsigned char uchar
Definition: qglobal.h:994
QString toUnicode(const QByteArray &) const
Converts a from the encoding of this codec to Unicode, and returns the result in a QString...
unsigned short ushort
Definition: qglobal.h:995

◆ fromLatin1()

QChar QChar::fromLatin1 ( char  c)
inlinestatic

◆ hasMirrored()

bool QChar::hasMirrored ( ) const

Returns true if the character should be reversed if the text direction is reversed; otherwise returns false.

Same as (ch.mirroredChar() != ch).

See also
mirroredChar()

Definition at line 968 of file qchar.cpp.

Referenced by QCharRef::hasMirrored().

969 {
970  return qGetProp(ucs)->mirrorDiff != 0;
971 }
ushort ucs
Definition: qchar.h:362
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ highSurrogate()

static ushort QChar::highSurrogate ( uint  ucs4)
inlinestatic

Returns the high surrogate value of a ucs4 code point.

The returned result is undefined if ucs4 is smaller than 0x10000.

Definition at line 303 of file qchar.h.

Referenced by canonicalOrderHelper(), QUtf8::convertToUnicode(), QUtf32::convertToUnicode(), QKeySequencePrivate::encodeString(), QTextHtmlParser::parseEntity(), qt_string_normalize(), QFontEngineWin::recalcAdvances(), QRawFont::supportsCharacter(), and QPatternist::XQueryTokenizer::tokenizeCharacterReference().

303  {
304  return ushort((ucs4>>10) + 0xd7c0);
305  }
unsigned short ushort
Definition: qglobal.h:995

◆ isDigit()

bool QChar::isDigit ( ) const

Returns true if the character is a decimal digit (Number_DecimalDigit); otherwise returns false.

Definition at line 699 of file qchar.cpp.

Referenced by QTextStreamPrivate::getNumber(), QTextStreamPrivate::getReal(), QCharRef::isDigit(), QPatternist::DerivedString< TypeToken >::isNameChar(), QFileSystemModelPrivate::naturalCompare(), qt_mac_get_key(), and totalDigitsForDecimal().

700 {
702 }
ushort ucs
Definition: qchar.h:362
Category category() const
Returns the character&#39;s category.
Definition: qchar.cpp:853
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ isHighSurrogate() [1/2]

bool QChar::isHighSurrogate ( ) const
inline

Returns true if the QChar is the high part of a utf16 surrogate (ie.

if its code point is between 0xd800 and 0xdbff, inclusive).

Definition at line 276 of file qchar.h.

Referenced by atsuPostLayoutCallback(), QLineControl::backspace(), canonicalOrderHelper(), composeHelper(), QUtf8::convertFromUnicode(), QTextCursor::deletePreviousChar(), foldCase(), mapToLowerCase(), QFontEngineMulti::stringToCMap(), QString::toLower(), toUcs4_helper(), and QString::toUpper().

276  {
277  return ((ucs & 0xfc00) == 0xd800);
278  }
ushort ucs
Definition: qchar.h:362

◆ isHighSurrogate() [2/2]

static bool QChar::isHighSurrogate ( uint  ucs4)
inlinestatic

Returns true if the UCS-4-encoded character specified by ucs4 is the high part of a utf16 surrogate (ie.

Since
4.7

if its code point is between 0xd800 and 0xdbff, inclusive).

Definition at line 288 of file qchar.h.

288  {
289  return ((ucs4 & 0xfffffc00) == 0xd800);
290  }

◆ isLetter()

bool QChar::isLetter ( ) const

◆ isLetterOrNumber()

bool QChar::isLetterOrNumber ( ) const

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

Definition at line 681 of file qchar.cpp.

Referenced by QDir::addResourceSearchPath(), QDeclarativeCompiler::checkValidId(), findInBlock(), QDeclarativeJS::Lexer::isIdentLetter(), QCharRef::isLetterOrNumber(), QDateTimeEditPrivate::isSeparatorKey(), QLineControl::isValidInput(), and isWord().

682 {
683  const int test = FLAG(Letter_Uppercase) |
687  FLAG(Letter_Other) |
691  return FLAG(qGetProp(ucs)->category) & test;
692 }
ushort ucs
Definition: qchar.h:362
Category category() const
Returns the character&#39;s category.
Definition: qchar.cpp:853
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
#define FLAG(x)
Definition: qchar.cpp:66

◆ isLower()

bool QChar::isLower ( ) const
inline

◆ isLowSurrogate() [1/2]

bool QChar::isLowSurrogate ( ) const
inline

Returns true if the QChar is the low part of a utf16 surrogate (ie.

if its code point is between 0xdc00 and 0xdfff, inclusive).

Definition at line 279 of file qchar.h.

Referenced by atsuPostLayoutCallback(), QLineControl::backspace(), canonicalOrderHelper(), composeHelper(), containsProhibitedOuptut(), QUtf8::convertFromUnicode(), QTextCursor::deletePreviousChar(), foldCase(), QFontEngineMulti::stringToCMap(), QString::toLower(), toUcs4_helper(), and QString::toUpper().

279  {
280  return ((ucs & 0xfc00) == 0xdc00);
281  }
ushort ucs
Definition: qchar.h:362

◆ isLowSurrogate() [2/2]

static bool QChar::isLowSurrogate ( uint  ucs4)
inlinestatic

Returns true if the UCS-4-encoded character specified by ucs4 is the low part of a utf16 surrogate (ie.

Since
4.7

if its code point is between 0xdc00 and 0xdfff, inclusive).

Definition at line 291 of file qchar.h.

291  {
292  return ((ucs4 & 0xfffffc00) == 0xdc00);
293  }

◆ isMark()

bool QChar::isMark ( ) const

Returns true if the character is a mark (Mark_* categories); otherwise returns false.

See QChar::Category for more information regarding marks.

Definition at line 625 of file qchar.cpp.

Referenced by QCharRef::isMark(), and isWord().

626 {
627  const int test = FLAG(Mark_NonSpacing) |
630  return FLAG(qGetProp(ucs)->category) & test;
631 }
ushort ucs
Definition: qchar.h:362
Category category() const
Returns the character&#39;s category.
Definition: qchar.cpp:853
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
#define FLAG(x)
Definition: qchar.cpp:66

◆ isNull()

bool QChar::isNull ( ) const
inline

◆ isNumber()

bool QChar::isNumber ( ) const

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

See also
isDigit()

Definition at line 669 of file qchar.cpp.

Referenced by QScriptCompletionTaskPrivate::completeScriptExpression(), QScriptDebuggerCodeView::event(), QCharRef::isNumber(), QDateTimeEditPrivate::isSeparatorKey(), and QLineControl::isValidInput().

670 {
671  const int test = FLAG(Number_DecimalDigit) |
674  return FLAG(qGetProp(ucs)->category) & test;
675 }
ushort ucs
Definition: qchar.h:362
Category category() const
Returns the character&#39;s category.
Definition: qchar.cpp:853
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
#define FLAG(x)
Definition: qchar.cpp:66

◆ isPrint()

bool QChar::isPrint ( ) const

Returns true if the character is a printable character; otherwise returns false.

This is any character not of category Cc or Cn.

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

Definition at line 598 of file qchar.cpp.

Referenced by QCharRef::isPrint(), QLineControl::isValidInput(), QTextControlPrivate::keyPressEvent(), QKeySequence::mnemonic(), QLineControl::processKeyEvent(), and QDoubleSpinBoxPrivate::validateAndInterpret().

599 {
600  const int test = FLAG(Other_Control) |
602  return !(FLAG(qGetProp(ucs)->category) & test);
603 }
ushort ucs
Definition: qchar.h:362
Category category() const
Returns the character&#39;s category.
Definition: qchar.cpp:853
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
#define FLAG(x)
Definition: qchar.cpp:66

◆ isPunct()

bool QChar::isPunct ( ) const

Returns true if the character is a punctuation mark (Punctuation_* categories); otherwise returns false.

Definition at line 637 of file qchar.cpp.

Referenced by QCharRef::isPunct().

638 {
639  const int test = FLAG(Punctuation_Connector) |
646  return FLAG(qGetProp(ucs)->category) & test;
647 }
ushort ucs
Definition: qchar.h:362
Category category() const
Returns the character&#39;s category.
Definition: qchar.cpp:853
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
#define FLAG(x)
Definition: qchar.cpp:66

◆ isSpace()

bool QChar::isSpace ( ) const

Returns true if the character is a separator character (Separator_* categories); otherwise returns false.

Definition at line 609 of file qchar.cpp.

Referenced by QTextHtmlImporter::appendNodeText(), QDateTimeParser::findDay(), QSqlDriver::formatValue(), QTextHtmlParserNode::hasOnlyWhitespace(), QCharRef::isSpace(), QPatternist::ProcessingInstructionConstructor::leftTrimmed(), Qt::mightBeRichText(), QFileSystemModelPrivate::naturalCompare(), QTextHtmlParser::newNode(), QPatternist::XQueryTokenizer::nextToken(), operator<<(), QDeclarativeDirParser::parse(), QDeclarativeStyledTextPrivate::parseCloseTag(), parseCombinedArgString(), QTextHtmlParser::parseEntity(), parseFontName(), parseNumbersArray(), parseNumbersList(), parsePathDataFast(), parsePercentageList(), QDateTimeParser::parseSection(), QDeclarativeStyledTextPrivate::parseTag(), parseTransformationMatrix(), QTextHtmlParser::parseWord(), QTextHtmlImporter::processSpecialNodes(), qt_set_x11_resources(), QTextStreamPrivate::scan(), QString::simplified(), QDeclarativeStyledTextPrivate::skipSpace(), QString::trimmed(), QDoubleSpinBoxPrivate::validateAndInterpret(), and QXmlStreamWriterPrivate::writeEscaped().

610 {
611  if(ucs >= 9 && ucs <=13)
612  return true;
613  const int test = FLAG(Separator_Space) |
616  return FLAG(qGetProp(ucs)->category) & test;
617 }
ushort ucs
Definition: qchar.h:362
Category category() const
Returns the character&#39;s category.
Definition: qchar.cpp:853
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
#define FLAG(x)
Definition: qchar.cpp:66

◆ isSymbol()

bool QChar::isSymbol ( ) const

Returns true if the character is a symbol (Symbol_* categories); otherwise returns false.

Definition at line 709 of file qchar.cpp.

Referenced by qt_mac_get_key().

710 {
711  const int test = FLAG(Symbol_Math) |
715  return FLAG(qGetProp(ucs)->category) & test;
716 }
ushort ucs
Definition: qchar.h:362
Category category() const
Returns the character&#39;s category.
Definition: qchar.cpp:853
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
#define FLAG(x)
Definition: qchar.cpp:66

◆ isTitleCase()

bool QChar::isTitleCase ( ) const
inline

Returns true if the character is a titlecase letter, i.

Since
4.3

e. category() is Letter_Titlecase.

See also
isLower(), toUpper(), toLower(), toTitleCase()

Definition at line 274 of file qchar.h.

Referenced by QCharRef::isTitleCase().

274 { return category() == Letter_Titlecase; }
Category category() const
Returns the character&#39;s category.
Definition: qchar.cpp:853

◆ isUpper()

bool QChar::isUpper ( ) const
inline

◆ joining() [1/3]

QChar::Joining QChar::joining ( ) const

Returns information about the joining properties of the character (needed for certain languages such as Arabic).

Definition at line 924 of file qchar.cpp.

Referenced by QCharRef::joining().

925 {
926  return (QChar::Joining) qGetProp(ucs)->joining;
927 }
Joining
This enum type defines the Unicode joining attributes.
Definition: qchar.h:182
ushort ucs
Definition: qchar.h:362
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ joining() [2/3]

QChar::Joining QChar::joining ( uint  ucs4)
static

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 938 of file qchar.cpp.

939 {
940  if (ucs4 > UNICODE_LAST_CODEPOINT)
941  return QChar::OtherJoining;
942  return (QChar::Joining) qGetProp(ucs4)->joining;
943 }
Joining
This enum type defines the Unicode joining attributes.
Definition: qchar.h:182
#define UNICODE_LAST_CODEPOINT
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ joining() [3/3]

QChar::Joining QChar::joining ( ushort  ucs2)
static

Returns information about the joining properties of the UCS-2-encoded character specified by ucs2 (needed for certain languages such as Arabic).

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 954 of file qchar.cpp.

955 {
956  return (QChar::Joining) qGetProp(ucs2)->joining;
957 }
Joining
This enum type defines the Unicode joining attributes.
Definition: qchar.h:182
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ lowSurrogate()

static ushort QChar::lowSurrogate ( uint  ucs4)
inlinestatic

Returns the low surrogate value of a ucs4 code point.

The returned result is undefined if ucs4 is smaller than 0x10000.

Definition at line 306 of file qchar.h.

Referenced by canonicalOrderHelper(), QUtf8::convertToUnicode(), QUtf32::convertToUnicode(), QKeySequencePrivate::encodeString(), QTextHtmlParser::parseEntity(), qt_string_normalize(), QFontEngineWin::recalcAdvances(), QRawFont::supportsCharacter(), and QPatternist::XQueryTokenizer::tokenizeCharacterReference().

306  {
307  return ushort(ucs4%0x400 + 0xdc00);
308  }
unsigned short ushort
Definition: qglobal.h:995

◆ mirroredChar() [1/3]

QChar QChar::mirroredChar ( ) const

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

See also
hasMirrored()

Definition at line 1016 of file qchar.cpp.

Referenced by QFontEngineWin::getGlyphIndexes(), HB_GetMirroredChar(), QCharRef::mirroredChar(), QFontEngineDirectWrite::stringToCMap(), QFontEngineXLFD::stringToCMap(), QFontEngineQPA::stringToCMap(), QFontEngineQPF::stringToCMap(), QFontEngineFT::stringToCMap(), and QFontEngineQPF1::stringToCMap().

1017 {
1018  return ucs + qGetProp(ucs)->mirrorDiff;
1019 }
ushort ucs
Definition: qchar.h:362
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ mirroredChar() [2/3]

uint QChar::mirroredChar ( uint  ucs4)
static

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
hasMirrored()

Definition at line 1031 of file qchar.cpp.

1032 {
1033  if (ucs4 > UNICODE_LAST_CODEPOINT)
1034  return ucs4;
1035  return ucs4 + qGetProp(ucs4)->mirrorDiff;
1036 }
#define UNICODE_LAST_CODEPOINT
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ mirroredChar() [3/3]

ushort QChar::mirroredChar ( ushort  ucs2)
static

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also
hasMirrored()

Definition at line 1048 of file qchar.cpp.

1049 {
1050  return ucs2 + qGetProp(ucs2)->mirrorDiff;
1051 }
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ requiresSurrogates()

static bool QChar::requiresSurrogates ( uint  ucs4)
inlinestatic

Returns true if the UCS-4-encoded character specified by ucs4 can be split into the high and low parts of a utf16 surrogate (ie.

Since
4.7

if its code point is greater than or equals to 0x10000).

Definition at line 294 of file qchar.h.

Referenced by canonicalOrderHelper(), decomposeHelper(), QKeySequencePrivate::encodeString(), QTextHtmlParser::parseEntity(), qt_string_normalize(), and QRawFont::supportsCharacter().

294  {
295  return (ucs4 >= 0x10000);
296  }

◆ row()

uchar QChar::row ( ) const
inline

◆ setCell()

void QChar::setCell ( uchar  cell)
inline
Warning
This function is not part of the public interface.

Definition at line 387 of file qchar.h.

Referenced by QUtf16::convertToUnicode(), and QCharRef::setCell().

388 { ucs = ushort((ucs & 0xff00) + acell); }
ushort ucs
Definition: qchar.h:362
unsigned short ushort
Definition: qglobal.h:995

◆ setRow()

void QChar::setRow ( uchar  row)
inline
Warning
This function is not part of the public interface.

Definition at line 389 of file qchar.h.

Referenced by QUtf16::convertToUnicode(), and QCharRef::setRow().

390 { ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); }
ushort ucs
Definition: qchar.h:362
unsigned short ushort
Definition: qglobal.h:995

◆ surrogateToUcs4() [1/2]

static uint QChar::surrogateToUcs4 ( ushort  high,
ushort  low 
)
inlinestatic

Converts a UTF16 surrogate pair with the given high and low values to its UCS-4 code point.

Definition at line 297 of file qchar.h.

Referenced by canonicalOrderHelper(), composeHelper(), containsProhibitedOuptut(), QGb18030Codec::convertFromUnicode(), QUtf8::convertFromUnicode(), QUtf32::convertFromUnicode(), decomposeHelper(), foldCase(), getChar(), mapToLowerCase(), qt_nameprep(), QString::toLower(), toUcs4_helper(), and QString::toUpper().

297  {
298  return (uint(high)<<10) + low - 0x35fdc00;
299  }
unsigned int uint
Definition: qglobal.h:996

◆ surrogateToUcs4() [2/2]

static uint QChar::surrogateToUcs4 ( QChar  high,
QChar  low 
)
inlinestatic

Converts a utf16 surrogate pair (high, low) to its ucs4 code point.

Definition at line 300 of file qchar.h.

300  {
301  return (uint(high.ucs)<<10) + low.ucs - 0x35fdc00;
302  }
ushort ucs
Definition: qchar.h:362
unsigned int uint
Definition: qglobal.h:996

◆ toAscii()

char QChar::toAscii ( ) const

Returns the character value of the QChar obtained using the current codec used to read C strings, or 0 if the character is not representable using this codec.

The default codec handles Latin-1 encoded text, but this can be changed to assist developers writing source code using other encodings.

The main purpose of this function is to preserve ASCII characters used in C strings. This is mainly useful for developers of non-internationalized software.

See also
toLatin1(), unicode(), QTextCodec::codecForCStrings()

Definition at line 1490 of file qchar.cpp.

Referenced by QPatternist::XQueryTokenizer::aheadEquals(), Maemo::appendVariantToDBusMessage(), QAbstractConcatenable::convertToAscii(), driveSpec(), fromHex(), QScriptSyntaxHighlighter::highlightBlock(), QPatternist::XQueryTokenizer::peekAhead(), QPatternist::XQueryTokenizer::peekCurrent(), QPatternist::XQueryTokenizer::peekForColonColon(), QCharRef::row(), QCharRef::toAscii(), toCaseFolded(), and QCharRef::unicode().

1492 {
1493 #ifndef QT_NO_CODEC_FOR_C_STRINGS
1495  // #####
1496  return QTextCodec::codecForCStrings()->fromUnicode(QString(*this)).at(0);
1497 #endif
1498  return ucs > 0xff ? 0 : char(ucs);
1499 }
ushort ucs
Definition: qchar.h:362
static QTextCodec * codecForCStrings()
Returns the codec used by QString to convert to and from const char * and QByteArrays.
Definition: qtextcodec.h:157
The QString class provides a Unicode character string.
Definition: qstring.h:83
QByteArray fromUnicode(const QString &uc) const
Converts str from Unicode to the encoding of this codec, and returns the result in a QByteArray...
char at(int i) const
Returns the character at index position i in the byte array.
Definition: qbytearray.h:413

◆ toCaseFolded() [1/3]

QChar QChar::toCaseFolded ( ) const

Returns the case folded equivalent of the character.

For most Unicode characters this is the same as toLowerCase().

Definition at line 1406 of file qchar.cpp.

Referenced by QString::replace().

1407 {
1408  return ucs + qGetProp(ucs)->caseFoldDiff;
1409 }
ushort ucs
Definition: qchar.h:362
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ toCaseFolded() [2/3]

uint QChar::toCaseFolded ( uint  ucs4)
static

Returns the case folded equivalent of the UCS-4-encoded character specified by ucs4.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. For most Unicode characters this is the same as toLowerCase().

Definition at line 1419 of file qchar.cpp.

1420 {
1421  if (ucs4 > UNICODE_LAST_CODEPOINT)
1422  return ucs4;
1423  return ucs4 + qGetProp(ucs4)->caseFoldDiff;
1424 }
#define UNICODE_LAST_CODEPOINT
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ toCaseFolded() [3/3]

ushort QChar::toCaseFolded ( ushort  ucs2)
static

Returns the case folded equivalent of the UCS-2-encoded character specified by ucs2.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. For most Unicode characters this is the same as toLowerCase().

Definition at line 1434 of file qchar.cpp.

1435 {
1436  return ucs2 + qGetProp(ucs2)->caseFoldDiff;
1437 }
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ toLatin1()

char QChar::toLatin1 ( ) const
inline

◆ toLower() [1/3]

QChar QChar::toLower ( ) const

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

Definition at line 1239 of file qchar.cpp.

Referenced by QFontPrivate::alterCharForCapitalization(), QLocalePrivate::codeToScript(), comify(), QDateTimeParser::findAmPm(), QRegExpEngine::getEscape(), QTextStreamPrivate::getNumber(), QTextStreamPrivate::getReal(), hasValidSignal(), QDeclarativePropertyPrivate::initProperty(), QKeyMapperPrivate::isADeadKey(), keySequenceToKeyEqivalent(), QRegExpMatchState::matchHere(), QFileSystemModelPrivate::naturalCompare(), QLocalePrivate::numberToCLocale(), QTextHtmlParser::parseEntity(), QOpenKODEWindow::processKeyEvents(), QDeclarative_isFileCaseCorrect(), QByteArray::qstricmp(), QByteArray::qstrnicmp(), QGtkStylePrivate::setupGtkFileChooser(), QTextEngine::shapeTextMac(), QTextEngine::shapeTextWithCE(), QTextEngine::shapeTextWithHarfbuzz(), timeFormatContainsAP(), QByteArray::toLower(), QCharRef::toLower(), QCharRef::unicode(), and QDateTimeEditPrivate::validateAndInterpret().

1240 {
1242  if (!p->lowerCaseSpecial)
1243  return ucs + p->lowerCaseDiff;
1244  return ucs;
1245 }
ushort ucs
Definition: qchar.h:362
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ toLower() [2/3]

uint QChar::toLower ( uint  ucs4)
static

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.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1256 of file qchar.cpp.

1257 {
1258  if (ucs4 > UNICODE_LAST_CODEPOINT)
1259  return ucs4;
1260  const QUnicodeTables::Properties *p = qGetProp(ucs4);
1261  if (!p->lowerCaseSpecial)
1262  return ucs4 + p->lowerCaseDiff;
1263  return ucs4;
1264 }
#define UNICODE_LAST_CODEPOINT
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ toLower() [3/3]

ushort QChar::toLower ( ushort  ucs2)
static

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1275 of file qchar.cpp.

1276 {
1277  const QUnicodeTables::Properties *p = qGetProp(ucs2);
1278  if (!p->lowerCaseSpecial)
1279  return ucs2 + p->lowerCaseDiff;
1280  return ucs2;
1281 }
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ toTitleCase() [1/3]

QChar QChar::toTitleCase ( ) const

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

Definition at line 1335 of file qchar.cpp.

Referenced by QCharRef::toTitleCase().

1336 {
1338  if (!p->titleCaseSpecial)
1339  return ucs + p->titleCaseDiff;
1340  return ucs;
1341 }
ushort ucs
Definition: qchar.h:362
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ toTitleCase() [2/3]

uint QChar::toTitleCase ( uint  ucs4)
static

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.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1352 of file qchar.cpp.

1353 {
1354  if (ucs4 > UNICODE_LAST_CODEPOINT)
1355  return ucs4;
1356  const QUnicodeTables::Properties *p = qGetProp(ucs4);
1357  if (!p->titleCaseSpecial)
1358  return ucs4 + p->titleCaseDiff;
1359  return ucs4;
1360 }
#define UNICODE_LAST_CODEPOINT
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ toTitleCase() [3/3]

ushort QChar::toTitleCase ( ushort  ucs2)
static

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1371 of file qchar.cpp.

1372 {
1373  const QUnicodeTables::Properties *p = qGetProp(ucs2);
1374  if (!p->titleCaseSpecial)
1375  return ucs2 + p->titleCaseDiff;
1376  return ucs2;
1377 }
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ toUpper() [1/3]

QChar QChar::toUpper ( ) const

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

Definition at line 1287 of file qchar.cpp.

Referenced by QFontPrivate::alterCharForCapitalization(), QCoreApplication::applicationDirPath(), QLocalePrivate::codeToScript(), QKeySequencePrivate::encodeString(), QDateTimeParser::findAmPm(), getFmtString(), hasUnquotedAP(), isDirPath(), QMenu::keyPressEvent(), QFSFileEnginePrivate::longFileName(), QKeySequence::mnemonic(), QDeclarativeProperty::name(), QFileSystemEngine::nativeAbsoluteFilePath(), QFileSystemModelPrivate::node(), parseFontName(), qt_mac_get_key(), qtKey2CocoaKey(), QGtkStylePrivate::setupGtkFileChooser(), QTextEngine::shapeTextMac(), QTextEngine::shapeTextWithCE(), QTextEngine::shapeTextWithHarfbuzz(), toKeyOrUnicode(), QByteArray::toUpper(), QCharRef::toUpper(), QXlibKeyboard::translateKeySym(), QXcbKeyboard::translateKeySym(), translateKeySym(), tryDriveUNCFallback(), and QCharRef::unicode().

1288 {
1290  if (!p->upperCaseSpecial)
1291  return ucs + p->upperCaseDiff;
1292  return ucs;
1293 }
ushort ucs
Definition: qchar.h:362
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ toUpper() [2/3]

uint QChar::toUpper ( uint  ucs4)
static

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1304 of file qchar.cpp.

1305 {
1306  if (ucs4 > UNICODE_LAST_CODEPOINT)
1307  return ucs4;
1308  const QUnicodeTables::Properties *p = qGetProp(ucs4);
1309  if (!p->upperCaseSpecial)
1310  return ucs4 + p->upperCaseDiff;
1311  return ucs4;
1312 }
#define UNICODE_LAST_CODEPOINT
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ toUpper() [3/3]

ushort QChar::toUpper ( ushort  ucs2)
static

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1323 of file qchar.cpp.

1324 {
1325  const QUnicodeTables::Properties *p = qGetProp(ucs2);
1326  if (!p->upperCaseSpecial)
1327  return ucs2 + p->upperCaseDiff;
1328  return ucs2;
1329 }
static const QUnicodeTables::Properties * qGetProp(uint ucs4)

◆ unicode() [1/2]

ushort QChar::unicode ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 251 of file qchar.h.

Referenced by QString::append(), QXmlSimpleReaderPrivate::atEnd(), QPatternist::XQueryTokenizer::attributeAsRaw(), canonicalOrderHelper(), QFontEngineWin::canRender(), QFontEngineQPF1::canRender(), QFontMetrics::charWidth(), comify(), composeHelper(), QFontJis0201Codec::convertFromUnicode(), QGb18030Codec::convertFromUnicode(), QBig5Codec::convertFromUnicode(), QFontLaoCodec::convertFromUnicode(), QUtf8::convertFromUnicode(), QIsciiCodec::convertFromUnicode(), QSimpleTextCodec::convertFromUnicode(), QIconvCodec::convertFromUnicode(), QBig5hkscsCodec::convertFromUnicode(), QUtf32::convertFromUnicode(), QGbkCodec::convertFromUnicode(), QLatin15Codec::convertFromUnicode(), QFontJis0208Codec::convertFromUnicode(), QEucKrCodec::convertFromUnicode(), QEucJpCodec::convertFromUnicode(), QGb2312Codec::convertFromUnicode(), QFontBig5Codec::convertFromUnicode(), QCP949Codec::convertFromUnicode(), QFontGb2312Codec::convertFromUnicode(), QFontBig5hkscsCodec::convertFromUnicode(), QFontKsc5601Codec::convertFromUnicode(), QFontGbkCodec::convertFromUnicode(), QAbstractConcatenable::convertToAscii(), QAbstractConcatenable::convertToLatin1(), QUtf16::convertToUnicode(), QLatin15Codec::convertToUnicode(), QRegExpEngine::createState(), QLocalePrivate::dateTimeToString(), QPatternist::CompressedWhitespace::decompress(), QLocalePrivate::digitToCLocale(), QLocalePrivate::doubleToString(), QWin32PrintEngine::drawTextItem(), QPdfBaseEnginePrivate::drawTextItem(), QString::endsWith(), QStringRef::endsWith(), equal(), QPatternist::escape(), escapedKey(), escapedString(), extractEncodingDecl(), fastDetermineNameChar(), findArgEscapes(), findChar(), findGraphicsFactory(), findGroupFactory(), findStyleFactoryMethod(), findStyleUtilFactoryMethod(), findUtilFactory(), fixedXmlName(), fromAscii(), QPatternist::HexBinary::fromHex(), QXmlStreamReaderPrivate::getChar(), QRegExpEngine::getChar(), getChar(), QXmlStreamReaderPrivate::getChar_helper(), QRegExpEngine::getEscape(), getEscape(), getMessage(), QTextStreamPrivate::getNumber(), QTextStreamPrivate::getReal(), heuristicSetGlyphAttributes(), QRegExpCharClass::in(), QSettingsPrivate::iniEscapedKey(), QSettingsPrivate::iniEscapedString(), QString::insert(), is_S(), QXmlUtils::isChar(), QXmlUtils::isNameChar(), QPatternist::XQueryTokenizer::isNCNameBody(), QXmlUtils::isPublicID(), isSupportedSvgFeature(), isValidCharacter(), isValidCharacterNoDash(), QLineControl::isValidInput(), isValidNumber(), QTextEngine::itemize(), QMenu::keyPressEvent(), keySequenceToKeyEqivalent(), QCssScanner_Generated::lex(), QUnicodeTables::lineBreakClass(), macToQtFormat(), mapToLowerCase(), QRegExpMatchState::match(), QKeySequence::mnemonic(), QScriptEnginePrivate::newRegExp(), QPatternist::ToCodepointsIterator::next(), QXmlInputSource::next(), QXmlSimpleReaderPrivate::next(), nextDotDelimiter(), QPatternist::XQueryTokenizer::nextToken(), QPatternist::XQueryTokenizer::normalizeEOL(), QLocalePrivate::numberToCLocale(), operator!=(), QString::operator+=(), operator<(), operator<<(), operator<<(), operator<=(), QCharRef::operator=(), operator==(), operator>(), operator>=(), operator>>(), QXmlStreamReaderPrivate::parse(), parse_locale_tag(), parseCoreNode(), parseFont(), QLineControl::parseInputMask(), parseNumbersArray(), parseNumbersList(), parsePathDataFast(), QXmlStreamReaderPrivate::peekChar(), QKeyMapper::possibleKeys(), QXmlStreamReaderPrivate::putChar(), QXmlStreamReaderPrivate::putReplacement(), QXmlStreamReaderPrivate::putReplacementInAttributeValue(), QXmlStreamReaderPrivate::putString(), QXmlStreamReaderPrivate::putStringLiteral(), QChar(), qHash(), qIsAlnum(), QString::QString(), QSvgAttributes::QSvgAttributes(), qt_ACE_do(), qt_check_std3rules(), qt_keyrelease_scanner(), qt_last_index_of(), qt_mac_get_key(), qt_nameprep(), qt_readEscapedFormatString(), qt_string_count(), qt_string_normalize(), qtKey2CocoaKey(), qtkeyForMacSymbol(), qulltoa(), QXmlUtils::rangeContains(), QString::remove(), QString::replace(), replaceArgEscapes(), resolveColor(), QCharRef::row(), QUnicodeTables::script(), QUrlPrivate::setAuthority(), QDirPrivate::setPath(), QTextEngine::shapeTextMac(), QTextEngine::shapeTextWithCE(), QString::startsWith(), QStringRef::startsWith(), stringContainsNullChar(), QFontEngineXLFD::stringToCMap(), QSystemLocalePrivate::substituteDigits(), QTextBlock::textDirection(), timeFormatContainsAP(), toDouble(), QPatternist::CompressedWhitespace::toIdentifier(), toKeyOrUnicode(), QTextDocument::toPlainText(), toPunycodeHelper(), QTest::toString(), QFontEngineXLFD::toUnicode(), QXlibKeyboard::translateKeySym(), QXcbKeyboard::translateKeySym(), translateKeySym(), tryDriveUNCFallback(), ucstrncmp(), QCharRef::unicode(), QLineControl::updateDisplayText(), QKeyMapperPrivate::updateKeyMap(), QLocalePrivate::updateSystemPrivate(), wc2rx(), QFontMetrics::width(), QFontMetricsF::width(), QSystemLocalePrivate::winToQtFormat(), QTextOdfWriter::writeBlock(), QXmlStreamWriterPrivate::writeEscaped(), and xpmHash().

251 { return ucs; }
ushort ucs
Definition: qchar.h:362

◆ unicode() [2/2]

ushort & QChar::unicode ( )
inline

Returns a reference to the numeric Unicode value of the QChar.

Definition at line 256 of file qchar.h.

256 { return ucs; }
ushort ucs
Definition: qchar.h:362

◆ unicodeVersion() [1/3]

QChar::UnicodeVersion QChar::unicodeVersion ( ) const

Returns the Unicode version that introduced this character.

Definition at line 1189 of file qchar.cpp.

Referenced by decomposeHelper(), qt_nameprep(), and QCharRef::unicodeVersion().

1190 {
1192 }
ushort ucs
Definition: qchar.h:362
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
UnicodeVersion
Specifies which version of the [Unicode standard](http://www.
Definition: qchar.h:212

◆ unicodeVersion() [2/3]

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

Returns the Unicode version that introduced the character specified in its UCS-4-encoded form as ucs4.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1202 of file qchar.cpp.

1203 {
1204  if (ucs4 > UNICODE_LAST_CODEPOINT)
1207 }
#define UNICODE_LAST_CODEPOINT
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
UnicodeVersion
Specifies which version of the [Unicode standard](http://www.
Definition: qchar.h:212

◆ unicodeVersion() [3/3]

QChar::UnicodeVersion QChar::unicodeVersion ( ushort  ucs2)
static

Returns the Unicode version that introduced the character specified in its UCS-2-encoded form as ucs2.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1217 of file qchar.cpp.

1218 {
1220 }
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
UnicodeVersion
Specifies which version of the [Unicode standard](http://www.
Definition: qchar.h:212

Friends and Related Functions

◆ operator!=()

int operator!= ( QChar  c1,
QChar  c2 
)
related

Returns true if c1 and c2 are not the same Unicode character; otherwise returns false.

Definition at line 393 of file qchar.h.

393 { return c1.unicode() != c2.unicode(); }
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251

◆ operator<()

int operator< ( QChar  c1,
QChar  c2 
)
related

Returns true if the numeric Unicode value of c1 is less than that of c2; otherwise returns false.

Definition at line 396 of file qchar.h.

396 { return c1.unicode() < c2.unicode(); }
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251

◆ operator<<()

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

Writes the char chr to the stream out.

See also
{Serializing Qt Data Types}

Definition at line 1542 of file qchar.cpp.

Referenced by operator>().

1543 {
1544  out << quint16(chr.unicode());
1545  return out;
1546 }
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
unsigned short quint16
Definition: qglobal.h:936

◆ operator<=()

int operator<= ( QChar  c1,
QChar  c2 
)
related

Returns true if the numeric Unicode value of c1 is less than or equal to that of c2; otherwise returns false.

Definition at line 394 of file qchar.h.

394 { return c1.unicode() <= c2.unicode(); }
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251

◆ operator==()

bool operator== ( QChar  c1,
QChar  c2 
)
related

Returns true if c1 and c2 are the same Unicode character; otherwise returns false.

Definition at line 392 of file qchar.h.

392 { return c1.unicode() == c2.unicode(); }
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251

◆ operator>()

int operator> ( QChar  c1,
QChar  c2 
)
related

Returns true if the numeric Unicode value of c1 is greater than that of c2; otherwise returns false.

Definition at line 397 of file qchar.h.

397 { return c1.unicode() > c2.unicode(); }
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251

◆ operator>=()

int operator>= ( QChar  c1,
QChar  c2 
)
related

Returns true if the numeric Unicode value of c1 is greater than or equal to that of c2; otherwise returns false.

Definition at line 395 of file qchar.h.

395 { return c1.unicode() >= c2.unicode(); }
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251

◆ operator>>()

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

Reads a char from the stream in into char chr.

See also
{Serializing Qt Data Types}

Definition at line 1558 of file qchar.cpp.

Referenced by operator>().

1559 {
1560  quint16 u;
1561  in >> u;
1562  chr.unicode() = ushort(u);
1563  return in;
1564 }
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
quint16 u
unsigned short quint16
Definition: qglobal.h:936
unsigned short ushort
Definition: qglobal.h:995

Properties

◆ ucs

ushort QChar::ucs
private

The documentation for this class was generated from the following files: