Obsolete Members for QChar

The following members of class QChar are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

Public Functions

char toAscii() const (obsolete)

Static Public Members

QChar fromAscii(char c) (obsolete)

Member Function Documentation

QChar QChar::fromAscii(char c) [static]

Converts the ASCII character c to it's equivalent QChar. This is mainly useful for non-internationalized software.

An alternative is to use QLatin1Char.

See also fromLatin1() and unicode().

char QChar::toAscii() const

Returns the Latin-1 character value of the QChar, or 0 if the character is not representable.

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.

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

Note: This function does not check whether the character value is inside the valid range of US-ASCII.

See also toLatin1() and unicode().