Qt logo

QChar Class Reference


A Unicode character. More...

#include <qstring.h>

List of all member functions.

Public Members

Static Public Members


Detailed Description

A Unicode character.

A QChar is a simple 16-bit value representing a Unicode character. Most C++ compilers will process them much as they would a "short int".

QChar values are normally used in combination with QString.

They can be trivially constructed from:

char
the char is assumed to be a Latin-1 character, for example QChar('Q') is the Unicode character U0051 and QChar('t') is the Unicode character U0074.
short
the MSB is the high-order byte (row) of the Unicode character, for example QChar(ushort(0x6817)) is the Unicode character U6817 meaning kuri - chestnut tree - in Japanese.
char, char
the characters are LSB and MSB respectively, for example QChar(0x25,0x04) is the Unicode character U0425 which is the Cyrillic letter YA which looks like a mirrored R.

Member Function Documentation

uchar QChar::cell () const

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

uchar& QChar::cell ()

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

QString QChar::decomposition () const

Decomposes a character into its parts. Returns QString::null if no decomposition exists.

int QChar::digitValue () const

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

bool QChar::isDigit () const

Returns whether the character is a decimal digit (Number_DecimalDigit).

bool QChar::isLetter () const

Returns whether the character is a letter (Letter_* categories).

bool QChar::isMark () const

Returns whether the character is a mark (Mark_* categories).

bool QChar::isNull () const

Returns TRUE if the charaters is the unicode character 0x0000, ie. ASCII NUL.

bool QChar::isNumber () const

Returns whether the character is a number (of any sort - Number_* categories).

See also: isDigit().

bool QChar::isPrint () const

Returns whether the character is a printable character. This is and character of category Cc or Cn. Note that this gives no indication of whether the character is available in some font.

bool QChar::isPunct () const

Returns whether the character is puntuation (Punctuation_* categories).

bool QChar::isSpace () const

Returns whether the character is a separator character (Separator_* categories).

QChar QChar::lower () const

Returns the lowercase equivalent if the character is uppercase, or the character itself otherwise.

bool QChar::mirrored () const

Returns whether the character is a mirrored character (one that should be reversed if the text direction is reversed).

uchar QChar::row () const

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

uchar& QChar::row ()

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

ushort QChar::unicode () const

Returns the numeric Unicode value equal to the QChar. Normally, you should use QChar objects as they are equivalent, but for some low-level tasks (eg. indexing into an array of Unicode information), this function is useful.

QChar QChar::upper () const

Returns the uppercase equivalent if the character is lowercase, or the character itself otherwise.


Search the documentation, FAQ, qt-interest archive and more (uses www.troll.no):


This file is part of the Qt toolkit, copyright © 1995-99 Troll Tech, all rights reserved.


Copyright © 1999 Troll TechTrademarks
Qt version 2.0.2