[][src]Struct qt_core::QChar

#[repr(C)]
pub struct QChar { /* fields omitted */ }

The QChar class provides a 16-bit Unicode character.

C++ class: QChar.

C++ documentation:

The QChar class provides a 16-bit Unicode character.

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 an 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, not just for the ASCII range. They all return true if the character is a certain type of character; otherwise they return false. These classification functions are isNull() (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. Some of these also calculate the derived properties (for example isSpace() returns true if the character is of category Separator_* or an exceptional code point from Other_Control category).

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

Composed Unicode characters (like ring) 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 fromLatin1(), or use QLatin1Char, to construct a QChar from an 8-bit char, and you will need to call toLatin1() to get the 8-bit value back.

For more information see "About the Unicode Character Database".

Methods

impl QChar[src]

pub unsafe fn category_0a(&self) -> Category[src]

Returns the character's category.

Calls C++ function: QChar::Category QChar::category() const.

C++ documentation:

Returns the character's category.

pub unsafe fn category_1a(ucs4: c_uint) -> Category[src]

This is an overloaded function.

Calls C++ function: static QChar::Category QChar::category(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn cell(&self) -> c_uchar[src]

Returns the cell (least significant byte) of the Unicode character.

Calls C++ function: unsigned char QChar::cell() const.

C++ documentation:

Returns the cell (least significant byte) of the Unicode character.

See also row().

pub unsafe fn combining_class_0a(&self) -> c_uchar[src]

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.

Calls C++ function: unsigned char QChar::combiningClass() const.

C++ documentation:

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.

pub unsafe fn combining_class_1a(ucs4: c_uint) -> c_uchar[src]

This is an overloaded function.

Calls C++ function: static unsigned char QChar::combiningClass(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn copy_from(
    &mut self,
    other: impl CastInto<Ref<QChar>>
) -> MutRef<QChar>
[src]

The QChar class provides a 16-bit Unicode character.

Calls C++ function: QChar& QChar::operator=(const QChar& other).

C++ documentation:

The QChar class provides a 16-bit Unicode character.

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 an 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, not just for the ASCII range. They all return true if the character is a certain type of character; otherwise they return false. These classification functions are isNull() (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. Some of these also calculate the derived properties (for example isSpace() returns true if the character is of category Separator_* or an exceptional code point from Other_Control category).

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

Composed Unicode characters (like ring) 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 fromLatin1(), or use QLatin1Char, to construct a QChar from an 8-bit char, and you will need to call toLatin1() to get the 8-bit value back.

For more information see "About the Unicode Character Database".

pub unsafe fn current_unicode_version() -> UnicodeVersion[src]

Returns the most recent supported Unicode version.

Calls C++ function: static QChar::UnicodeVersion QChar::currentUnicodeVersion().

C++ documentation:

Returns the most recent supported Unicode version.

pub unsafe fn decomposition_0a(&self) -> CppBox<QString>[src]

Decomposes a character into it's constituent parts. Returns an empty string if no decomposition exists.

Calls C++ function: QString QChar::decomposition() const.

C++ documentation:

Decomposes a character into it's constituent parts. Returns an empty string if no decomposition exists.

pub unsafe fn decomposition_1a(ucs4: c_uint) -> CppBox<QString>[src]

This is an overloaded function.

Calls C++ function: static QString QChar::decomposition(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Decomposes the UCS-4-encoded character specified by ucs4 into it's constituent parts. Returns an empty string if no decomposition exists.

pub unsafe fn decomposition_tag_0a(&self) -> Decomposition[src]

Returns the tag defining the composition of the character. Returns QChar::NoDecomposition if no decomposition exists.

Calls C++ function: QChar::Decomposition QChar::decompositionTag() const.

C++ documentation:

Returns the tag defining the composition of the character. Returns QChar::NoDecomposition if no decomposition exists.

pub unsafe fn decomposition_tag_1a(ucs4: c_uint) -> Decomposition[src]

This is an overloaded function.

Calls C++ function: static QChar::Decomposition QChar::decompositionTag(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns the tag defining the composition of the UCS-4-encoded character specified by ucs4. Returns QChar::NoDecomposition if no decomposition exists.

pub unsafe fn digit_value_0a(&self) -> c_int[src]

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

Calls C++ function: int QChar::digitValue() const.

C++ documentation:

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

pub unsafe fn digit_value_1a(ucs4: c_uint) -> c_int[src]

This is an overloaded function.

Calls C++ function: static int QChar::digitValue(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn direction_0a(&self) -> Direction[src]

Returns the character's direction.

Calls C++ function: QChar::Direction QChar::direction() const.

C++ documentation:

Returns the character's direction.

pub unsafe fn direction_1a(ucs4: c_uint) -> Direction[src]

This is an overloaded function.

Calls C++ function: static QChar::Direction QChar::direction(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn from_latin1(c: c_char) -> CppBox<QChar>[src]

Converts the Latin-1 character c to its equivalent QChar. This is mainly useful for non-internationalized software.

Calls C++ function: static QChar QChar::fromLatin1(char c).

C++ documentation:

Converts the Latin-1 character c to its equivalent QChar. This is mainly useful for non-internationalized software.

An alternative is to use QLatin1Char.

See also toLatin1() and unicode().

pub unsafe fn has_mirrored_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::hasMirrored() const.

C++ documentation:

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

A bit faster equivalent of (ch.mirroredChar() != ch).

See also mirroredChar().

pub unsafe fn has_mirrored_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::hasMirrored(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 should be reversed if the text direction is reversed; otherwise returns false.

A bit faster equivalent of (QChar::mirroredChar(ucs4) != ucs4).

This function was introduced in Qt 5.0.

See also mirroredChar().

pub unsafe fn high_surrogate(ucs4: c_uint) -> c_ushort[src]

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

Calls C++ function: static unsigned short QChar::highSurrogate(unsigned int ucs4).

C++ documentation:

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

pub unsafe fn is_digit_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::isDigit() const.

C++ documentation:

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

See also isNumber().

pub unsafe fn is_digit_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isDigit(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is a decimal digit (Number_DecimalDigit); otherwise returns false.

This function was introduced in Qt 5.0.

See also isNumber().

pub unsafe fn is_high_surrogate_0a(&self) -> bool[src]

Returns true if the QChar is the high part of a UTF16 surrogate (for example if its code point is in range [0xd800..0xdbff]); false otherwise.

Calls C++ function: bool QChar::isHighSurrogate() const.

C++ documentation:

Returns true if the QChar is the high part of a UTF16 surrogate (for example if its code point is in range [0xd800..0xdbff]); false otherwise.

pub unsafe fn is_high_surrogate_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isHighSurrogate(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is the high part of a UTF16 surrogate (for example if its code point is in range [0xd800..0xdbff]); false otherwise.

pub unsafe fn is_letter_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::isLetter() const.

C++ documentation:

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

pub unsafe fn is_letter_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isLetter(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is a letter (Letter_* categories); otherwise returns false.

This function was introduced in Qt 5.0.

pub unsafe fn is_letter_or_number_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::isLetterOrNumber() const.

C++ documentation:

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

pub unsafe fn is_letter_or_number_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isLetterOrNumber(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is a letter or number (Letter_* or Number_* categories); otherwise returns false.

This function was introduced in Qt 5.0.

pub unsafe fn is_low_surrogate_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::isLowSurrogate() const.

C++ documentation:

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

pub unsafe fn is_low_surrogate_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isLowSurrogate(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is the low part of a UTF16 surrogate (for example if its code point is in range [0xdc00..0xdfff]); false otherwise.

pub unsafe fn is_lower_0a(&self) -> bool[src]

Returns true if the character is a lowercase letter, for example category() is Letter_Lowercase.

Calls C++ function: bool QChar::isLower() const.

C++ documentation:

Returns true if the character is a lowercase letter, for example category() is Letter_Lowercase.

See also isUpper(), toLower(), and toUpper().

pub unsafe fn is_lower_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isLower(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is a lowercase letter, for example category() is Letter_Lowercase.

This function was introduced in Qt 5.0.

See also isUpper(), toLower(), and toUpper().

pub unsafe fn is_mark_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::isMark() const.

C++ documentation:

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

See QChar::Category for more information regarding marks.

pub unsafe fn is_mark_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isMark(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is a mark (Mark_* categories); otherwise returns false.

This function was introduced in Qt 5.0.

pub unsafe fn is_non_character_0a(&self) -> bool[src]

Returns true if the QChar is a non-character; false otherwise.

Calls C++ function: bool QChar::isNonCharacter() const.

C++ documentation:

Returns true if the QChar is a non-character; false otherwise.

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

This function was introduced in Qt 5.0.

pub unsafe fn is_non_character_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isNonCharacter(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is a non-character; false otherwise.

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

This function was introduced in Qt 5.0.

pub unsafe fn is_null(&self) -> bool[src]

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

Calls C++ function: bool QChar::isNull() const.

C++ documentation:

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

pub unsafe fn is_number_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::isNumber() const.

C++ documentation:

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

See also isDigit().

pub unsafe fn is_number_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isNumber(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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

This function was introduced in Qt 5.0.

See also isDigit().

pub unsafe fn is_print_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::isPrint() const.

C++ documentation:

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

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

pub unsafe fn is_print_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isPrint(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is a printable character; otherwise returns false. This is any character not of category Other_*.

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

This function was introduced in Qt 5.0.

pub unsafe fn is_punct_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::isPunct() const.

C++ documentation:

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

pub unsafe fn is_punct_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isPunct(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is a punctuation mark (Punctuation_* categories); otherwise returns false.

This function was introduced in Qt 5.0.

pub unsafe fn is_space_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::isSpace() const.

C++ documentation:

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

pub unsafe fn is_space_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isSpace(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is a separator character (Separator_* categories or certain code points from Other_Control category); otherwise returns false.

This function was introduced in Qt 5.0.

pub unsafe fn is_surrogate_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::isSurrogate() const.

C++ documentation:

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

This function was introduced in Qt 5.0.

pub unsafe fn is_surrogate_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isSurrogate(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 contains a code point that is in either the high or the low part of the UTF-16 surrogate range (for example if its code point is in range [0xd800..0xdfff]); false otherwise.

This function was introduced in Qt 5.0.

pub unsafe fn is_symbol_0a(&self) -> bool[src]

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

Calls C++ function: bool QChar::isSymbol() const.

C++ documentation:

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

pub unsafe fn is_symbol_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isSymbol(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is a symbol (Symbol_* categories); otherwise returns false.

This function was introduced in Qt 5.0.

pub unsafe fn is_title_case_0a(&self) -> bool[src]

Returns true if the character is a titlecase letter, for example category() is Letter_Titlecase.

Calls C++ function: bool QChar::isTitleCase() const.

C++ documentation:

Returns true if the character is a titlecase letter, for example category() is Letter_Titlecase.

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

pub unsafe fn is_title_case_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isTitleCase(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is a titlecase letter, for example category() is Letter_Titlecase.

This function was introduced in Qt 5.0.

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

pub unsafe fn is_upper_0a(&self) -> bool[src]

Returns true if the character is an uppercase letter, for example category() is Letter_Uppercase.

Calls C++ function: bool QChar::isUpper() const.

C++ documentation:

Returns true if the character is an uppercase letter, for example category() is Letter_Uppercase.

See also isLower(), toUpper(), and toLower().

pub unsafe fn is_upper_1a(ucs4: c_uint) -> bool[src]

This is an overloaded function.

Calls C++ function: static bool QChar::isUpper(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

Returns true if the UCS-4-encoded character specified by ucs4 is an uppercase letter, for example category() is Letter_Uppercase.

This function was introduced in Qt 5.0.

See also isLower(), toUpper(), and toLower().

pub unsafe fn joining_0a(&self) -> Joining[src]

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

Calls C++ function: QChar::Joining QChar::joining() const.

C++ documentation:

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

pub unsafe fn joining_1a(ucs4: c_uint) -> Joining[src]

This is an overloaded function.

Calls C++ function: static QChar::Joining QChar::joining(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn joining_type_0a(&self) -> JoiningType[src]

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

Calls C++ function: QChar::JoiningType QChar::joiningType() const.

C++ documentation:

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

This function was introduced in Qt 5.3.

pub unsafe fn joining_type_1a(ucs4: c_uint) -> JoiningType[src]

This is an overloaded function.

Calls C++ function: static QChar::JoiningType QChar::joiningType(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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

This function was introduced in Qt 5.3.

pub unsafe fn low_surrogate(ucs4: c_uint) -> c_ushort[src]

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

Calls C++ function: static unsigned short QChar::lowSurrogate(unsigned int ucs4).

C++ documentation:

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

pub unsafe fn mirrored_char_0a(&self) -> CppBox<QChar>[src]

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

Calls C++ function: QChar QChar::mirroredChar() const.

C++ documentation:

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

See also hasMirrored().

pub unsafe fn mirrored_char_1a(ucs4: c_uint) -> c_uint[src]

This is an overloaded function.

Calls C++ function: static unsigned int QChar::mirroredChar(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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

See also hasMirrored().

pub unsafe fn new() -> CppBox<QChar>[src]

Constructs a null QChar ('\0').

Calls C++ function: [constructor] void QChar::QChar().

C++ documentation:

Constructs a null QChar ('\0').

See also isNull().

pub unsafe fn from_ushort(rc: c_ushort) -> CppBox<QChar>[src]

Calls C++ function: [constructor] void QChar::QChar(unsigned short rc).

pub unsafe fn from_2_uchar(c: c_uchar, r: c_uchar) -> CppBox<QChar>[src]

Calls C++ function: [constructor] void QChar::QChar(unsigned char c, unsigned char r).

pub unsafe fn from_short(rc: c_short) -> CppBox<QChar>[src]

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

Calls C++ function: [constructor] void QChar::QChar(short rc).

C++ documentation:

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

pub unsafe fn from_uint(rc: c_uint) -> CppBox<QChar>[src]

Calls C++ function: [constructor] void QChar::QChar(unsigned int rc).

pub unsafe fn from_int(rc: c_int) -> CppBox<QChar>[src]

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

Calls C++ function: [constructor] void QChar::QChar(int rc).

C++ documentation:

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

pub unsafe fn from_special_character(s: SpecialCharacter) -> CppBox<QChar>[src]

Constructs a QChar for the predefined character value ch.

Calls C++ function: [constructor] void QChar::QChar(QChar::SpecialCharacter s).

C++ documentation:

Constructs a QChar for the predefined character value ch.

pub unsafe fn from_q_latin1_char(
    ch: impl CastInto<Ref<QLatin1Char>>
) -> CppBox<QChar>
[src]

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

Calls C++ function: [constructor] void QChar::QChar(QLatin1Char ch).

C++ documentation:

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

pub unsafe fn from_char(c: c_char) -> CppBox<QChar>[src]

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

Calls C++ function: [constructor] void QChar::QChar(char c).

C++ documentation:

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

Note: This constructor is not available when QT_NO_CAST_FROM_ASCII is defined.

See also QT_NO_CAST_FROM_ASCII.

pub unsafe fn from_uchar(c: c_uchar) -> CppBox<QChar>[src]

Calls C++ function: [constructor] void QChar::QChar(unsigned char c).

pub unsafe fn new_copy(other: impl CastInto<Ref<QChar>>) -> CppBox<QChar>[src]

The QChar class provides a 16-bit Unicode character.

Calls C++ function: [constructor] void QChar::QChar(const QChar& other).

C++ documentation:

The QChar class provides a 16-bit Unicode character.

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 an 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, not just for the ASCII range. They all return true if the character is a certain type of character; otherwise they return false. These classification functions are isNull() (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. Some of these also calculate the derived properties (for example isSpace() returns true if the character is of category Separator_* or an exceptional code point from Other_Control category).

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

Composed Unicode characters (like ring) 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 fromLatin1(), or use QLatin1Char, to construct a QChar from an 8-bit char, and you will need to call toLatin1() to get the 8-bit value back.

For more information see "About the Unicode Character Database".

pub unsafe fn requires_surrogates(ucs4: c_uint) -> bool[src]

Returns true if the UCS-4-encoded character specified by ucs4 can be split into the high and low parts of a UTF16 surrogate (for example if its code point is greater than or equals to 0x10000); false otherwise.

Calls C++ function: static bool QChar::requiresSurrogates(unsigned int ucs4).

C++ documentation:

Returns true if the UCS-4-encoded character specified by ucs4 can be split into the high and low parts of a UTF16 surrogate (for example if its code point is greater than or equals to 0x10000); false otherwise.

pub unsafe fn row(&self) -> c_uchar[src]

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

Calls C++ function: unsigned char QChar::row() const.

C++ documentation:

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

See also cell().

pub unsafe fn script_0a(&self) -> Script[src]

Returns the Unicode script property value for this character.

Calls C++ function: QChar::Script QChar::script() const.

C++ documentation:

Returns the Unicode script property value for this character.

This function was introduced in Qt 5.1.

pub unsafe fn script_1a(ucs4: c_uint) -> Script[src]

This is an overloaded function.

Calls C++ function: static QChar::Script QChar::script(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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

This function was introduced in Qt 5.1.

pub unsafe fn set_cell(&mut self, acell: c_uchar)[src]

Calls C++ function: void QChar::setCell(unsigned char acell).

pub unsafe fn set_row(&mut self, arow: c_uchar)[src]

Calls C++ function: void QChar::setRow(unsigned char arow).

pub unsafe fn surrogate_to_ucs4_2_ushort(
    high: c_ushort,
    low: c_ushort
) -> c_uint
[src]

Converts a UTF16 surrogate pair with the given high and low values to it's UCS-4-encoded code point.

Calls C++ function: static unsigned int QChar::surrogateToUcs4(unsigned short high, unsigned short low).

C++ documentation:

Converts a UTF16 surrogate pair with the given high and low values to it's UCS-4-encoded code point.

pub unsafe fn surrogate_to_ucs4_2_q_char(
    high: impl CastInto<Ref<QChar>>,
    low: impl CastInto<Ref<QChar>>
) -> c_uint
[src]

This is an overloaded function.

Calls C++ function: static unsigned int QChar::surrogateToUcs4(QChar high, QChar low).

C++ documentation:

This is an overloaded function.

Converts a UTF16 surrogate pair (high, low) to it's UCS-4-encoded code point.

pub unsafe fn to_case_folded_0a(&self) -> CppBox<QChar>[src]

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

Calls C++ function: QChar QChar::toCaseFolded() const.

C++ documentation:

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

pub unsafe fn to_case_folded_1a(ucs4: c_uint) -> c_uint[src]

This is an overloaded function.

Calls C++ function: static unsigned int QChar::toCaseFolded(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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

pub unsafe fn to_latin1(&self) -> c_char[src]

Returns the Latin-1 character equivalent to the QChar, or 0. This is mainly useful for non-internationalized software.

Calls C++ function: char QChar::toLatin1() const.

C++ documentation:

Returns the Latin-1 character equivalent to the QChar, or 0. This is mainly useful for non-internationalized software.

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

See also unicode().

pub unsafe fn to_lower_0a(&self) -> CppBox<QChar>[src]

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

Calls C++ function: QChar QChar::toLower() const.

C++ documentation:

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

pub unsafe fn to_lower_1a(ucs4: c_uint) -> c_uint[src]

This is an overloaded function.

Calls C++ function: static unsigned int QChar::toLower(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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.

pub unsafe fn to_title_case_0a(&self) -> CppBox<QChar>[src]

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

Calls C++ function: QChar QChar::toTitleCase() const.

C++ documentation:

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

pub unsafe fn to_title_case_1a(ucs4: c_uint) -> c_uint[src]

This is an overloaded function.

Calls C++ function: static unsigned int QChar::toTitleCase(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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.

pub unsafe fn to_upper_0a(&self) -> CppBox<QChar>[src]

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

Calls C++ function: QChar QChar::toUpper() const.

C++ documentation:

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

pub unsafe fn to_upper_1a(ucs4: c_uint) -> c_uint[src]

This is an overloaded function.

Calls C++ function: static unsigned int QChar::toUpper(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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.

pub unsafe fn unicode(&self) -> c_ushort[src]

Returns the numeric Unicode value of the QChar.

Calls C++ function: unsigned short QChar::unicode() const.

C++ documentation:

Returns the numeric Unicode value of the QChar.

pub unsafe fn unicode_mut(&mut self) -> MutRef<c_ushort>[src]

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

Calls C++ function: unsigned short& QChar::unicode().

C++ documentation:

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

pub unsafe fn unicode_version_0a(&self) -> UnicodeVersion[src]

Returns the Unicode version that introduced this character.

Calls C++ function: QChar::UnicodeVersion QChar::unicodeVersion() const.

C++ documentation:

Returns the Unicode version that introduced this character.

pub unsafe fn unicode_version_1a(ucs4: c_uint) -> UnicodeVersion[src]

This is an overloaded function.

Calls C++ function: static QChar::UnicodeVersion QChar::unicodeVersion(unsigned int ucs4).

C++ documentation:

This is an overloaded function.

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

Trait Implementations

impl PartialEq<Ref<QChar>> for QChar[src]

fn eq(&self, c2: &Ref<QChar>) -> bool[src]

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

Calls C++ function: bool operator==(QChar c1, QChar c2).

C++ documentation:

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

impl PartialEq<Ref<QString>> for QChar[src]

fn eq(&self, rhs: &Ref<QString>) -> bool[src]

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

Calls C++ function: bool operator==(QChar lhs, const QString& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(QChar c1, QChar c2):

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

impl PartialEq<Ref<QStringRef>> for QChar[src]

fn eq(&self, rhs: &Ref<QStringRef>) -> bool[src]

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

Calls C++ function: bool operator==(QChar lhs, const QStringRef& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(QChar c1, QChar c2):

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

impl PartialEq<Ref<QLatin1String>> for QChar[src]

fn eq(&self, rhs: &Ref<QLatin1String>) -> bool[src]

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

Calls C++ function: bool operator==(QChar lhs, QLatin1String rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool operator==(QChar c1, QChar c2):

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

impl<'_> Add<Ref<QString>> for &'_ QChar[src]

type Output = CppBox<QString>

The resulting type after applying the + operator.

fn add(self, s2: Ref<QString>) -> CppBox<QString>[src]

Calls C++ function: QString operator+(QChar s1, const QString& s2).

impl<'_> Add<Ref<QStringRef>> for &'_ QChar[src]

type Output = CppBox<QString>

The resulting type after applying the + operator.

fn add(self, s2: Ref<QStringRef>) -> CppBox<QString>[src]

Calls C++ function: QString operator+(QChar s1, const QStringRef& s2).

impl Lt<Ref<QChar>> for QChar[src]

unsafe fn lt(&self, c2: &Ref<QChar>) -> bool[src]

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

Calls C++ function: bool operator<(QChar c1, QChar c2).

C++ documentation:

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

impl Lt<Ref<QString>> for QChar[src]

unsafe fn lt(&self, rhs: &Ref<QString>) -> bool[src]

Calls C++ function: bool operator<(QChar lhs, const QString& rhs).

impl Lt<Ref<QStringRef>> for QChar[src]

unsafe fn lt(&self, rhs: &Ref<QStringRef>) -> bool[src]

Calls C++ function: bool operator<(QChar lhs, const QStringRef& rhs).

impl Lt<Ref<QLatin1String>> for QChar[src]

unsafe fn lt(&self, rhs: &Ref<QLatin1String>) -> bool[src]

Calls C++ function: bool operator<(QChar lhs, QLatin1String rhs).

impl Le<Ref<QChar>> for QChar[src]

unsafe fn le(&self, c2: &Ref<QChar>) -> bool[src]

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

Calls C++ function: bool operator<=(QChar c1, QChar c2).

C++ documentation:

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

impl Le<Ref<QString>> for QChar[src]

unsafe fn le(&self, rhs: &Ref<QString>) -> bool[src]

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

Calls C++ function: bool operator<=(QChar lhs, const QString& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool 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.

impl Le<Ref<QStringRef>> for QChar[src]

unsafe fn le(&self, rhs: &Ref<QStringRef>) -> bool[src]

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

Calls C++ function: bool operator<=(QChar lhs, const QStringRef& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool 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.

impl Le<Ref<QLatin1String>> for QChar[src]

unsafe fn le(&self, rhs: &Ref<QLatin1String>) -> bool[src]

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

Calls C++ function: bool operator<=(QChar lhs, QLatin1String rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool 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.

impl Gt<Ref<QChar>> for QChar[src]

unsafe fn gt(&self, c2: &Ref<QChar>) -> bool[src]

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

Calls C++ function: bool operator>(QChar c1, QChar c2).

C++ documentation:

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

impl Gt<Ref<QString>> for QChar[src]

unsafe fn gt(&self, rhs: &Ref<QString>) -> bool[src]

Calls C++ function: bool operator>(QChar lhs, const QString& rhs).

impl Gt<Ref<QStringRef>> for QChar[src]

unsafe fn gt(&self, rhs: &Ref<QStringRef>) -> bool[src]

Calls C++ function: bool operator>(QChar lhs, const QStringRef& rhs).

impl Gt<Ref<QLatin1String>> for QChar[src]

unsafe fn gt(&self, rhs: &Ref<QLatin1String>) -> bool[src]

Calls C++ function: bool operator>(QChar lhs, QLatin1String rhs).

impl Ge<Ref<QChar>> for QChar[src]

unsafe fn ge(&self, c2: &Ref<QChar>) -> bool[src]

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

Calls C++ function: bool operator>=(QChar c1, QChar c2).

C++ documentation:

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

impl Ge<Ref<QString>> for QChar[src]

unsafe fn ge(&self, rhs: &Ref<QString>) -> bool[src]

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

Calls C++ function: bool operator>=(QChar lhs, const QString& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool 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.

impl Ge<Ref<QStringRef>> for QChar[src]

unsafe fn ge(&self, rhs: &Ref<QStringRef>) -> bool[src]

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

Calls C++ function: bool operator>=(QChar lhs, const QStringRef& rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool 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.

impl Ge<Ref<QLatin1String>> for QChar[src]

unsafe fn ge(&self, rhs: &Ref<QLatin1String>) -> bool[src]

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

Calls C++ function: bool operator>=(QChar lhs, QLatin1String rhs).

Warning: no exact match found in C++ documentation. Below is the C++ documentation for bool 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.

impl CppDeletable for QChar[src]

unsafe fn delete(&mut self)[src]

The QChar class provides a 16-bit Unicode character.

Calls C++ function: [destructor] void QChar::~QChar().

C++ documentation:

The QChar class provides a 16-bit Unicode character.

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 an 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, not just for the ASCII range. They all return true if the character is a certain type of character; otherwise they return false. These classification functions are isNull() (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. Some of these also calculate the derived properties (for example isSpace() returns true if the character is of category Separator_* or an exceptional code point from Other_Control category).

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

Composed Unicode characters (like ring) 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 fromLatin1(), or use QLatin1Char, to construct a QChar from an 8-bit char, and you will need to call toLatin1() to get the 8-bit value back.

For more information see "About the Unicode Character Database".

Auto Trait Implementations

impl Send for QChar

impl Sync for QChar

impl Unpin for QChar

impl UnwindSafe for QChar

impl RefUnwindSafe for QChar

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]