Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > 28b9e36e96ce34b2567ae5b47a27b2c5 > files > 1177

python-qt4-doc-4.10.3-3.mga4.noarch.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QTextFragment Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTextFragment Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTextFragment class holds a piece of text in a <a href="qtextdocument.html">QTextDocument</a> with a single <a href="qtextcharformat.html">QTextCharFormat</a>. <a href="#details">More...</a></p>

<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtextfragment.html#QTextFragment">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextfragment.html#QTextFragment-2">__init__</a></b> (<i>self</i>, QTextFragment&#160;<i>o</i>)</li><li><div class="fn" />QTextCharFormat <b><a href="qtextfragment.html#charFormat">charFormat</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextfragment.html#charFormatIndex">charFormatIndex</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextfragment.html#contains">contains</a></b> (<i>self</i>, int&#160;<i>position</i>)</li><li><div class="fn" />list-of-QGlyphRun <b><a href="qtextfragment.html#glyphRuns">glyphRuns</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextfragment.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextfragment.html#length">length</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextfragment.html#position">position</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qtextfragment.html#text">text</a></b> (<i>self</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qtextfragment.html#__eq__">__eq__</a></b> (<i>self</i>, QTextFragment&#160;<i>o</i>)</li><li><div class="fn" />bool <b><a href="qtextfragment.html#__ge__">__ge__</a></b> (<i>self</i>, QTextFragment&#160;<i>o</i>)</li><li><div class="fn" />bool <b><a href="qtextfragment.html#__lt__">__lt__</a></b> (<i>self</i>, QTextFragment&#160;<i>o</i>)</li><li><div class="fn" />bool <b><a href="qtextfragment.html#__ne__">__ne__</a></b> (<i>self</i>, QTextFragment&#160;<i>o</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTextFragment class holds a piece of text in a <a href="qtextdocument.html">QTextDocument</a> with a single <a href="qtextcharformat.html">QTextCharFormat</a>.</p>
<p>A text fragment describes a piece of text that is stored with a
single character format. Text in which the character format changes
can be represented by sequences of text fragments with different
formats.</p>
<p>If the user edits the text in a fragment and introduces a
different character format, the fragment's text will be split at
each point where the format changes, and new fragments will be
created. For example, changing the style of some text in the middle
of a sentence will cause the fragment to be broken into three
separate fragments: the first and third with the same format as
before, and the second with the new style. The first fragment will
contain the text from the beginning of the sentence, the second
will contain the text from the middle, and the third takes the text
from the end of the sentence.</p>
<p class="centerAlign"><img alt="" src="images/qtextfragment-split.png" /></p>
<p>A fragment's text and character format can be obtained with the
<a href="qtextfragment.html#text">text</a>() and <a href="qtextfragment.html#charFormat">charFormat</a>() functions. The
<a href="qtextfragment.html#length">length</a>() function gives the
length of the text in the fragment. <a href="qtextfragment.html#position">position</a>() gives the position in
the document of the start of the fragment. To determine whether the
fragment contains a particular position within the document, use
the <a href="qtextfragment.html#contains">contains</a>()
function.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTextFragment" />QTextFragment.__init__ (<i>self</i>)</h3><p>Creates a new empty text fragment.</p>


<h3 class="fn"><a name="QTextFragment-2" />QTextFragment.__init__ (<i>self</i>, <a href="qtextfragment.html">QTextFragment</a>&#160;<i>o</i>)</h3><h3 class="fn"><a name="charFormat" /><a href="qtextcharformat.html">QTextCharFormat</a> QTextFragment.charFormat (<i>self</i>)</h3><p>Returns the text fragment's character format.</p>
<p><b>See also</b> <a href="qtextfragment.html#text">text</a>().</p>


<h3 class="fn"><a name="charFormatIndex" />int QTextFragment.charFormatIndex (<i>self</i>)</h3><p>Returns an index into the document's internal list of character
formats for the text fragment's character format.</p>
<p><b>See also</b> <a href="qtextdocument.html#allFormats">QTextDocument.allFormats</a>().</p>


<h3 class="fn"><a name="contains" />bool QTextFragment.contains (<i>self</i>, int&#160;<i>position</i>)</h3><p>Returns true if the text fragment contains the text at the given
<i>position</i> in the document; otherwise returns false.</p>


<h3 class="fn"><a name="glyphRuns" />list-of-QGlyphRun QTextFragment.glyphRuns (<i>self</i>)</h3><p>Returns the glyphs of this text fragment. The positions of the
glyphs are relative to the position of the <a href="qtextblock.html">QTextBlock</a>'s layout.</p>
<p><b>See also</b> <a href="qglyphrun.html">QGlyphRun</a>, <a href="qtextblock.html#layout">QTextBlock.layout</a>(), <a href="qtextlayout.html#position">QTextLayout.position</a>(), and
<a href="qpainter.html#drawGlyphRun">QPainter.drawGlyphRun</a>().</p>


<h3 class="fn"><a name="isValid" />bool QTextFragment.isValid (<i>self</i>)</h3><p>Returns true if this is a valid text fragment (i.e. has a valid
position in a document); otherwise returns false.</p>


<h3 class="fn"><a name="length" />int QTextFragment.length (<i>self</i>)</h3><p>Returns the number of characters in the text fragment.</p>
<p><b>See also</b> <a href="qtextfragment.html#text">text</a>().</p>


<h3 class="fn"><a name="position" />int QTextFragment.position (<i>self</i>)</h3><p>Returns the position of this text fragment in the document.</p>


<h3 class="fn"><a name="text" />QString QTextFragment.text (<i>self</i>)</h3><p>Returns the text fragment's as plain text.</p>
<p><b>See also</b> <a href="qtextfragment.html#length">length</a>()
and <a href="qtextfragment.html#charFormat">charFormat</a>().</p>


<h3 class="fn"><a name="__eq__" />bool QTextFragment.__eq__ (<i>self</i>, <a href="qtextfragment.html">QTextFragment</a>&#160;<i>o</i>)</h3><h3 class="fn"><a name="__ge__" />bool QTextFragment.__ge__ (<i>self</i>, <a href="qtextfragment.html">QTextFragment</a>&#160;<i>o</i>)</h3><h3 class="fn"><a name="__lt__" />bool QTextFragment.__lt__ (<i>self</i>, <a href="qtextfragment.html">QTextFragment</a>&#160;<i>o</i>)</h3><h3 class="fn"><a name="__ne__" />bool QTextFragment.__ne__ (<i>self</i>, <a href="qtextfragment.html">QTextFragment</a>&#160;<i>o</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.10.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.5</td></tr></table></div></address></body></html>