📄 qchar.cpp
字号:
\fn QChar::QChar(int code) Constructs a QChar for the character with Unicode code point \a code.*//*! \fn bool QChar::isNull() const Returns true if the character is the Unicode character 0x0000 ('\\0'); otherwise returns false.*//*! \fn uchar QChar::cell() const Returns the cell (least significant byte) of the Unicode character. \sa row()*//*! \fn uchar QChar::row() const Returns the row (most significant byte) of the Unicode character. \sa cell()*//*! 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.*/bool QChar::isPrint() const{ Category c = ::category(*this); return c != Other_Control && c != Other_NotAssigned;}/*! Returns true if the character is a separator character (Separator_* categories); otherwise returns false.*/bool QChar::isSpace() const{ return ::isSpace(*this);}/*! Returns true if the character is a mark (Mark_* categories); otherwise returns false.*/bool QChar::isMark() const{ Category c = ::category(*this); return c >= Mark_NonSpacing && c <= Mark_Enclosing;}/*! Returns true if the character is a punctuation mark (Punctuation_* categories); otherwise returns false.*/bool QChar::isPunct() const{ Category c = ::category(*this); return (c >= Punctuation_Connector && c <= Punctuation_Other);}/*! Returns true if the character is a letter (Letter_* categories); otherwise returns false.*/bool QChar::isLetter() const{ Category c = ::category(*this); return (c >= Letter_Uppercase && c <= Letter_Other);}/*! Returns true if the character is a number (Number_* categories, not just 0-9); otherwise returns false. \sa isDigit()*/bool QChar::isNumber() const{ Category c = ::category(*this); return c >= Number_DecimalDigit && c <= Number_Other;}/*! Returns true if the character is a letter or number (Letter_* or Number_* categories); otherwise returns false.*/bool QChar::isLetterOrNumber() const{ Category c = ::category(*this); return (c >= Letter_Uppercase && c <= Letter_Other) || (c >= Number_DecimalDigit && c <= Number_Other);}/*! Returns true if the character is a decimal digit (Number_DecimalDigit); otherwise returns false.*/bool QChar::isDigit() const{ return (::category(*this) == Number_DecimalDigit);}/*! Returns true if the character is a symbol (Symbol_* categories); otherwise returns false.*/bool QChar::isSymbol() const{ Category c = ::category(*this); return c >= Symbol_Math && c <= Symbol_Other;}/*! Returns the numeric value of the digit, or -1 if the character is not a digit.*/int QChar::digitValue() const{ return QUnicodeTables::digitValue(ucs);}/*! Returns the character's category.*/QChar::Category QChar::category() const{ return ::category(*this);}/*! Returns the character's direction.*/QChar::Direction QChar::direction() const{ return ::direction(*this);}/*! \preliminary Returns information about the joining properties of the character (needed for certain languages such as Arabic).*/QChar::Joining QChar::joining() const{ return ::joining(*this);}/*! Returns true if the character should be reversed if the text direction is reversed; otherwise returns false. \sa mirroredChar()*/bool QChar::hasMirrored() const{ return ::mirrored(*this);}/*! \fn bool QChar::isLower() const Returns true if the character is a lowercase letter, i.e. category() is Letter_Lowercase. \sa isUpper(), toLower(), toUpper()*//*! \fn bool QChar::isUpper() const Returns true if the character is an uppercase letter, i.e. category() is Letter_Uppercase. \sa isLower(), toUpper(), toLower()*//*! Returns the mirrored character if this character is a mirrored character; otherwise returns the character itself. \sa hasMirrored()*/QChar QChar::mirroredChar() const{ return ::mirroredChar(*this);}/*! Decomposes a character into its parts. Returns an empty string if no decomposition exists.*/QString QChar::decomposition() const{ return QUnicodeTables::decomposition(ucs);}/*! Returns the tag defining the composition of the character. Returns QChar::Single if no decomposition exists.*/QChar::Decomposition QChar::decompositionTag() const{ return QUnicodeTables::decompositionTag(ucs);}/*! 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.*/unsigned char QChar::combiningClass() const{ return ::combiningClass(*this);}/*! Returns the Unicode version that introduced this character.*/QChar::UnicodeVersion QChar::unicodeVersion() const{ return QUnicodeTables::unicodeVersion(ucs);}/*! Returns the lowercase equivalent if the character is uppercase; otherwise returns the character itself.*/QChar QChar::toLower() const{ return ::lower(*this);}/*! Returns the uppercase equivalent if the character is lowercase; otherwise returns the character itself.*/QChar QChar::toUpper() const{ return ::upper(*this);}/*! \fn char QChar::latin1() const Use toLatin1() instead.*//*! \fn char QChar::ascii() const Use toAscii() instead.*//*! \fn char QChar::toLatin1() const Returns the Latin-1 character equivalent to the QChar, or 0. This is mainly useful for non-internationalized software. \sa toAscii(), unicode(), QTextCodec::codecForCStrings()*//*! 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. \sa toLatin1(), unicode(), QTextCodec::codecForCStrings()*/const char QChar::toAscii() const{#ifndef QT_NO_CODEC_FOR_C_STRINGS if (QTextCodec::codecForCStrings()) // ##### return QTextCodec::codecForCStrings()->fromUnicode(QString(*this)).at(0);#endif return ucs > 0xff ? 0 : char(ucs);}/*! \fn QChar QChar::fromLatin1(char c) Converts the Latin-1 character \a c to its equivalent QChar. This is mainly useful for non-internationalized software. \sa fromAscii(), unicode(), QTextCodec::codecForCStrings()*//*! Converts the ASCII character \a c to its equivalent QChar. This is mainly useful for non-internationalized software. An alternative is to use QLatin1Char. \sa fromLatin1(), unicode(), QTextCodec::codecForCStrings()*/QChar QChar::fromAscii(char c){#ifndef QT_NO_CODEC_FOR_C_STRINGS if (QTextCodec::codecForCStrings()) // ##### return QTextCodec::codecForCStrings()->toUnicode(&c, 1).at(0).unicode();#endif return QChar(ushort((uchar)c));}#ifndef QT_NO_DATASTREAM/*! \relates QChar Writes the char \a chr to the stream \a out. \sa {Format of the QDataStream operators} */QDataStream &operator<<(QDataStream &out, const QChar &chr){ out << quint16(chr.unicode()); return out;}/*! \relates QChar Reads a char from the stream \a in into char \a chr. \sa {Format of the QDataStream operators} */QDataStream &operator>>(QDataStream &in, QChar &chr){ quint16 u; in >> u; chr.unicode() = ushort(u); return in;}#endif/*! \fn ushort & QChar::unicode() Returns a reference to the numberic Unicode value of the QChar.*//*! \fn ushort QChar::unicode() const \overload*//***************************************************************************** Documentation of QChar related functions *****************************************************************************//*! \fn bool operator==(QChar c1, QChar c2) \relates QChar Returns true if \a c1 and \a c2 are the same Unicode character; otherwise returns false.*//*! \fn int operator!=(QChar c1, QChar c2) \relates QChar Returns true if \a c1 and \a c2 are not the same Unicode character; otherwise returns false.*//*! \fn int operator<=(QChar c1, QChar c2) \relates QChar Returns true if the numeric Unicode value of \a c1 is less than or equal to that of \a c2; otherwise returns false.*//*! \fn int operator>=(QChar c1, QChar c2) \relates QChar Returns true if the numeric Unicode value of \a c1 is greater than or equal to that of \a c2; otherwise returns false.*//*! \fn int operator<(QChar c1, QChar c2) \relates QChar Returns true if the numeric Unicode value of \a c1 is less than that of \a c2; otherwise returns false.*//*! \fn int operator>(QChar c1, QChar c2) \relates QChar Returns true if the numeric Unicode value of \a c1 is greater than that of \a c2; otherwise returns false.*//*! \fn bool QChar::mirrored() const Use hasMirrored() instead.*//*! \fn QChar QChar::lower() const Use toLower() instead.*//*! \fn QChar QChar::upper() const Use toUpper() instead.*//*! \fn bool QChar::networkOrdered() See if QSysInfo::ByteOrder == QSysInfo::BigEndian instead.*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -