qchar.html
来自「QT 下载资料仅供参考」· HTML 代码 · 共 543 行 · 第 1/2 页
HTML
543 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/tools/qstring.cpp:11327 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QChar Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QChar Class Reference</h1><p>The QChar class provides a lightweight Unicode character.<a href="#details">More...</a><p><tt>#include <<a href="qstring-h.html">qstring.h</a>></tt><p><a href="qchar-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QChar"><b>QChar</b></a> ()</div></li><li><div class=fn><a href="#QChar-2"><b>QChar</b></a> ( char c )</div></li><li><div class=fn><a href="#QChar-3"><b>QChar</b></a> ( uchar c )</div></li><li><div class=fn><a href="#QChar-4"><b>QChar</b></a> ( uchar c, uchar r )</div></li><li><div class=fn><a href="#QChar-5"><b>QChar</b></a> ( const QChar & c )</div></li><li><div class=fn><a href="#QChar-6"><b>QChar</b></a> ( ushort rc )</div></li><li><div class=fn><a href="#QChar-7"><b>QChar</b></a> ( short rc )</div></li><li><div class=fn><a href="#QChar-8"><b>QChar</b></a> ( uint rc )</div></li><li><div class=fn><a href="#QChar-9"><b>QChar</b></a> ( int rc )</div></li><li><div class=fn>enum <a href="#Category-enum"><b>Category</b></a> { 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_Dask = Punctuation_Dash, Punctuation_Open, Punctuation_Close, Punctuation_InitialQuote, Punctuation_FinalQuote, Punctuation_Other, Symbol_Math, Symbol_Currency, Symbol_Modifier, Symbol_Other }</div></li><li><div class=fn>enum <a href="#Direction-enum"><b>Direction</b></a> { DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON, DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN }</div></li><li><div class=fn>enum <a href="#Decomposition-enum"><b>Decomposition</b></a> { Single, Canonical, Font, NoBreak, Initial, Medial, Final, Isolated, Circle, Super, Sub, Vertical, Wide, Narrow, Small, Square, Compat, Fraction }</div></li><li><div class=fn>enum <a href="#Joining-enum"><b>Joining</b></a> { OtherJoining, Dual, Right, Center }</div></li><li><div class=fn>enum <a href="#CombiningClass-enum"><b>CombiningClass</b></a> { 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 }</div></li><li><div class=fn>int <a href="#digitValue"><b>digitValue</b></a> () const</div></li><li><div class=fn>QChar <a href="#lower"><b>lower</b></a> () const</div></li><li><div class=fn>QChar <a href="#upper"><b>upper</b></a> () const</div></li><li><div class=fn>Category <a href="#category"><b>category</b></a> () const</div></li><li><div class=fn>Direction <a href="#direction"><b>direction</b></a> () const</div></li><li><div class=fn>Joining <a href="#joining"><b>joining</b></a> () const</div></li><li><div class=fn>bool <a href="#mirrored"><b>mirrored</b></a> () const</div></li><li><div class=fn>QChar <a href="#mirroredChar"><b>mirroredChar</b></a> () const</div></li><li><div class=fn>const QString & <a href="#decomposition"><b>decomposition</b></a> () const</div></li><li><div class=fn>Decomposition <a href="#decompositionTag"><b>decompositionTag</b></a> () const</div></li><li><div class=fn>unsigned char <a href="#combiningClass"><b>combiningClass</b></a> () const</div></li><li><div class=fn>char <a href="#latin1"><b>latin1</b></a> () const</div></li><li><div class=fn>ushort <a href="#unicode"><b>unicode</b></a> () const</div></li><li><div class=fn>ushort & <a href="#unicode-2"><b>unicode</b></a> ()</div></li><li><div class=fn><a href="#operator-char"><b>operator char</b></a> () const</div></li><li><div class=fn>bool <a href="#isNull"><b>isNull</b></a> () const</div></li><li><div class=fn>bool <a href="#isPrint"><b>isPrint</b></a> () const</div></li><li><div class=fn>bool <a href="#isPunct"><b>isPunct</b></a> () const</div></li><li><div class=fn>bool <a href="#isSpace"><b>isSpace</b></a> () const</div></li><li><div class=fn>bool <a href="#isMark"><b>isMark</b></a> () const</div></li><li><div class=fn>bool <a href="#isLetter"><b>isLetter</b></a> () const</div></li><li><div class=fn>bool <a href="#isNumber"><b>isNumber</b></a> () const</div></li><li><div class=fn>bool <a href="#isLetterOrNumber"><b>isLetterOrNumber</b></a> () const</div></li><li><div class=fn>bool <a href="#isDigit"><b>isDigit</b></a> () const</div></li><li><div class=fn>bool <a href="#isSymbol"><b>isSymbol</b></a> () const</div></li><li><div class=fn>uchar <a href="#cell"><b>cell</b></a> () const</div></li><li><div class=fn>uchar <a href="#row"><b>row</b></a> () const</div></li></ul><h2>Static Public Members</h2><ul><li><div class=fn>bool <a href="#networkOrdered"><b>networkOrdered</b></a> ()</div></li></ul><h2>Related Functions</h2><ul><li><div class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( QChar c1, QChar c2 )</div></li><li><div class=fn>bool <a href="#operator-eq-eq-2"><b>operator==</b></a> ( char ch, QChar c )</div></li><li><div class=fn>bool <a href="#operator-eq-eq-3"><b>operator==</b></a> ( QChar c, char ch )</div></li><li><div class=fn>int <a href="#operator!-eq"><b>operator!=</b></a> ( QChar c1, QChar c2 )</div></li><li><div class=fn>int <a href="#operator!-eq-2"><b>operator!=</b></a> ( char ch, QChar c )</div></li><li><div class=fn>int <a href="#operator!-eq-3"><b>operator!=</b></a> ( QChar c, char ch )</div></li><li><div class=fn>int <a href="#operator-lt-eq"><b>operator<=</b></a> ( QChar c1, QChar c2 )</div></li><li><div class=fn>int <a href="#operator-lt-eq-2"><b>operator<=</b></a> ( QChar c, char ch )</div></li><li><div class=fn>int <a href="#operator-lt-eq-3"><b>operator<=</b></a> ( char ch, QChar c )</div></li><li><div class=fn>int <a href="#operator-gt-eq"><b>operator>=</b></a> ( QChar c1, QChar c2 )</div></li><li><div class=fn>int <a href="#operator-gt-eq-2"><b>operator>=</b></a> ( QChar c, char ch )</div></li><li><div class=fn>int <a href="#operator-gt-eq-3"><b>operator>=</b></a> ( char ch, QChar c )</div></li><li><div class=fn>int <a href="#operator-lt"><b>operator<</b></a> ( QChar c1, QChar c2 )</div></li><li><div class=fn>int <a href="#operator-lt-2"><b>operator<</b></a> ( QChar c, char ch )</div></li><li><div class=fn>int <a href="#operator-lt-3"><b>operator<</b></a> ( char ch, QChar c )</div></li><li><div class=fn>int <a href="#operator-gt"><b>operator></b></a> ( QChar c1, QChar c2 )</div></li><li><div class=fn>int <a href="#operator-gt-2"><b>operator></b></a> ( QChar c, char ch )</div></li><li><div class=fn>int <a href="#operator-gt-3"><b>operator></b></a> ( char ch, QChar c )</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2> <p> The QChar class provides a lightweight Unicode character.<p> Unicode characters are (so far) 16-bit entities without any markup orstructure. This class represents such an entity. It islightweight, so it can be used everywhere. Most compilers treat itlike a "short int." (In a few years it may be necessaryto make QChar 32-bit when more than 65536 Unicode code points havebeen defined and come into use.)<p> QChar provides a full complement of testing/classification functions,converting to and from other formats, converting from composed to decomposedUnicode, and trying to compare and case-convert if you ask it to.<p> The classification functions include functions like those in ctype.h,but operating on the full range of Unicode characters. They allreturn TRUE if the character is a certain type of character;otherwise they return FALSE. These classification functions are <a href="#isNull">isNull</a>()(returns TRUE if the character is U+0000), <a href="#isPrint">isPrint</a>() (TRUE if thecharacter is any sort of printable character, including whitespace),<a href="#isPunct">isPunct</a>() (any sort of punctation), <a href="#isMark">isMark</a>() (Unicode Mark), isLetter(a letter), <a href="#isNumber">isNumber</a>() (any sort of numeric character),<a href="#isLetterOrNumber">isLetterOrNumber</a>(), and <a href="#isDigit">isDigit</a>() (decimal digits). All of these arewrappers around <a href="#category">category</a>() which return the Unicode-defined category ofeach character.<p> QChar further provides <a href="#direction">direction</a>(), which indicates the "natural"writing direction of this character. The <a href="#joining">joining</a>() function indicates howthe character joins with its neighbors (needed mostly for Arabic)and finally <a href="#mirrored">mirrored</a>(), which indicates whether the character needsto be mirrored when it is printed in its "unnatural" writingdirection.<p> Composed Unicode characters (like å) can be converted todecomposed Unicode ("a" followed by "ring above") by using<a href="#decomposition">decomposition</a>().<p> In Unicode, comparison is not necessarily possible and caseconversion is very difficult at best. Unicode, covering the "entire"world, also includes most of the world's case and sortingproblems. Qt tries, but not very hard: operator== and friends will docomparison based purely on the numeric Unicode value (code point) ofthe characters, and <a href="#upper">upper</a>() and <a href="#lower">lower</a>() will do case changes when thecharacter has a well-defined upper/lower-case equivalent. There is noprovision for locale-dependent case folding rules or comparison; thesefunctions are meant to be fast so they can be used unambiguously indata structures. (See <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>() though.)<p> The conversion functions include <a href="#unicode">unicode</a>() (to a scalar), <a href="#latin1">latin1</a>() (toscalar, but converts all non-Latin1 characters to 0), <a href="#row">row</a>() (gives theUnicode row), <a href="#cell">cell</a>() (gives the Unicode cell), <a href="#digitValue">digitValue</a>() (gives theinteger value of any of the numerous digit characters), and a host ofconstructors.<p> More information can be found in the document<a href="unicode.html">About Unicode.</a><p> <p>See also <a href="qstring.html">QString</a>, <a href="qcharref.html">QCharRef</a> and <a href="text.html">Text Related Classes</a>.<hr><h2>Member Type Documentation</h2><h3 class=fn><a name="Category-enum"></a>QChar::Category</h3> <p> This enum maps the Unicode character categories. The followingcharacters are normative in Unicode:<ul><li><tt>QChar::Mark_NonSpacing</tt> - Unicode class name Mn<li><tt>QChar::Mark_SpacingCombining</tt> - Unicode class name Mc<li><tt>QChar::Mark_Enclosing</tt> - Unicode class name Me<li><tt>QChar::Number_DecimalDigit</tt> - Unicode class name Nd<li><tt>QChar::Number_Letter</tt> - Unicode class name Nl<li><tt>QChar::Number_Other</tt> - Unicode class name No<li><tt>QChar::Separator_Space</tt> - Unicode class name Zs<li><tt>QChar::Separator_Line</tt> - Unicode class name Zl<li><tt>QChar::Separator_Paragraph</tt> - Unicode class name Zp<li><tt>QChar::Other_Control</tt> - Unicode class name Cc<li><tt>QChar::Other_Format</tt> - Unicode class name Cf<li><tt>QChar::Other_Surrogate</tt> - Unicode class name Cs<li><tt>QChar::Other_PrivateUse</tt> - Unicode class name Co<li><tt>QChar::Other_NotAssigned</tt> - Unicode class name Cn</ul><p> The following categories are informative in Unicode:<ul><li><tt>QChar::Letter_Uppercase</tt> - Unicode class name Lu<li><tt>QChar::Letter_Lowercase</tt> - Unicode class name Ll<li><tt>QChar::Letter_Titlecase</tt> - Unicode class name Lt<li><tt>QChar::Letter_Modifier</tt> - Unicode class name Lm<li><tt>QChar::Letter_Other</tt> - Unicode class name Lo<li><tt>QChar::Punctuation_Connector</tt> - Unicode class name Pc<li><tt>QChar::Punctuation_Dash</tt> - Unicode class name Pd<li><tt>QChar::Punctuation_Open</tt> - Unicode class name Ps<li><tt>QChar::Punctuation_Close</tt> - Unicode class name Pe<li><tt>QChar::Punctuation_InitialQuote</tt> - Unicode class name Pi<li><tt>QChar::Punctuation_FinalQuote</tt> - Unicode class name Pf<li><tt>QChar::Punctuation_Other</tt> - Unicode class name Po<li><tt>QChar::Symbol_Math</tt> - Unicode class name Sm<li><tt>QChar::Symbol_Currency</tt> - Unicode class name Sc<li><tt>QChar::Symbol_Modifier</tt> - Unicode class name Sk<li><tt>QChar::Symbol_Other</tt> - Unicode class name So</ul><p> There are two categories that are specific to Qt:<ul><li><tt>QChar::NoCategory</tt> - used when Qt is dazed and confused and cannotmake sense of anything.<li><tt>QChar::Punctuation_Dask</tt> - old typo alias for Punctuation_Dash</ul><p> <h3 class=fn><a name="CombiningClass-enum"></a>QChar::CombiningClass</h3> <p> This enum defines names for some of the combining classes definedin the Unicode standard.See <a href="http://www.unicode.org/">the Unicode Standard</a>for a more detailed description.<h3 class=fn><a name="Decomposition-enum"></a>QChar::Decomposition</h3> <p> This enum type defines the Unicode decomposition attributes.See <a href="http://www.unicode.org/">the Unicode Standard</a>for a description of the values.<h3 class=fn><a name="Direction-enum"></a>QChar::Direction</h3> <p> This enum type defines the Unicode direction attributes.See <a href="http://www.unicode.org/">the Unicode Standard</a>for a description of the values.<p> In order to conform to C/C++ naming conventions "Dir" isprepended to the codes used in the Unicode Standard.<h3 class=fn><a name="Joining-enum"></a>QChar::Joining</h3> <p> This enum type defines the Unicode decomposition attributes.See <a href="http://www.unicode.org/">the Unicode Standard</a>for a description of the values.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QChar"></a>QChar::QChar ()</h3> <p> Constructs a null QChar (one that <a href="#isNull">isNull</a>()).<h3 class=fn><a name="QChar-2"></a>QChar::QChar ( char c )</h3> <p> Constructs a QChar corresponding to ASCII/Latin1 character <em>c</em>.<h3 class=fn><a name="QChar-3"></a>QChar::QChar ( uchar c )</h3> <p> Constructs a QChar corresponding to ASCII/Latin1 character <em>c</em>.<h3 class=fn><a name="QChar-4"></a>QChar::QChar ( uchar c, uchar r )</h3> <p> Constructs a QChar for Unicode cell <em>c</em> in row <em>r</em>.<h3 class=fn><a name="QChar-5"></a>QChar::QChar ( const <a href="qchar.html">QChar</a> & c )</h3> <p> Constructs a copy of <em>c</em>. This is a <a href="shclass.html#deep-copy">deep copy</a>, if such alightweight object can be said to have deep copies.<h3 class=fn><a name="QChar-6"></a>QChar::QChar ( ushort rc )</h3> <p> Constructs a QChar for the character with Unicode code point <em>rc</em>.<h3 class=fn><a name="QChar-7"></a>QChar::QChar ( short rc )</h3> <p> Constructs a QChar for the character with Unicode code point <em>rc</em>.<h3 class=fn><a name="QChar-8"></a>QChar::QChar ( uint rc )</h3> <p> Constructs a QChar for the character with Unicode code point <em>rc</em>.<h3 class=fn><a name="QChar-9"></a>QChar::QChar ( int rc )</h3> <p> Constructs a QChar for the character with Unicode code point <em>rc</em>.<h3 class=fn><a href="qchar.html#Category-enum">Category</a> <a name="category"></a>QChar::category () const</h3>Returns the character category.<p> <p>See also <a href="#Category-enum">Category</a>.<h3 class=fn>uchar <a name="cell"></a>QChar::cell () const</h3>Returns the cell (least significant byte) of the Unicode character.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?