<class name="QTextFragment" doc="/**
&lt;p&gt;The &lt;a href=&quot;QTextFragment.html#QTextFragment()&quot;&gt;&lt;tt&gt;QTextFragment&lt;/tt&gt;&lt;/a&gt; class holds a piece of text in a &lt;a href=&quot;QTextDocument.html&quot;&gt;&lt;tt&gt;QTextDocument&lt;/tt&gt;&lt;/a&gt; with a single &lt;a href=&quot;QTextCharFormat.html&quot;&gt;&lt;tt&gt;QTextCharFormat&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;%2E%2E/images/qtextfragment-split.png&quot; /&gt;&lt;/p&gt;&lt;p&gt;A fragment's text and character format can be obtained with the &lt;a href=&quot;QTextFragment.html#text()&quot;&gt;&lt;tt&gt;text&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QTextFragment.html#charFormat()&quot;&gt;&lt;tt&gt;charFormat&lt;/tt&gt;&lt;/a&gt; functions. The &lt;a href=&quot;QTextFragment.html#length()&quot;&gt;&lt;tt&gt;length&lt;/tt&gt;&lt;/a&gt; function gives the length of the text in the fragment. &lt;a href=&quot;QTextFragment.html#position()&quot;&gt;&lt;tt&gt;position&lt;/tt&gt;&lt;/a&gt; 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 &lt;a href=&quot;QTextFragment.html#contains(int)&quot;&gt;&lt;tt&gt;contains&lt;/tt&gt;&lt;/a&gt; function.&lt;/p&gt;

@see &lt;a href=&quot;QTextDocument.html&quot;&gt;&lt;tt&gt;QTextDocument&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;%2E%2E/richtext-structure.html&quot;&gt;Rich Text Document Structure&lt;/tt&gt;&lt;/a&gt; */">
    <method name="public QTextFragment(com.trolltech.qt.gui.QTextFragment o)" doc="/**
&lt;p&gt;Copies the content (text and format) of the &lt;tt&gt;o&lt;/tt&gt; text fragment to this text fragment.&lt;/p&gt;
 */"/>
    <method name="public QTextFragment()" doc="/**
&lt;p&gt;Creates a new empty text fragment.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.gui.QTextCharFormat charFormat()" doc="/**
&lt;p&gt;Returns the text fragment's character format.&lt;/p&gt;

@see &lt;a href=&quot;QTextFragment.html#text()&quot;&gt;&lt;tt&gt;text&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int charFormatIndex()" doc="/**
&lt;p&gt;Returns an index into the document's internal list of character formats for the text fragment's character format.&lt;/p&gt;

@see &lt;tt&gt;QTextDocument::object&lt;/tt&gt; */"/>
    <method name="public final boolean contains(int position)" doc="/**
&lt;p&gt;Returns true if the text fragment contains the text at the given &lt;tt&gt;position&lt;/tt&gt; in the document; otherwise returns false.&lt;/p&gt;
 */"/>
    <method name="public final boolean isValid()" doc="/**
&lt;p&gt;Returns true if this is a valid text fragment (i.e&amp;#x2e; has a valid position in a document); otherwise returns false.&lt;/p&gt;
 */"/>
    <method name="public final int length()" doc="/**
&lt;p&gt;Returns the number of characters in the text fragment.&lt;/p&gt;

@see &lt;a href=&quot;QTextFragment.html#text()&quot;&gt;&lt;tt&gt;text&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int position()" doc="/**
&lt;p&gt;Returns the position of this text fragment in the document.&lt;/p&gt;
 */"/>
    <method name="public final java.lang.String text()" doc="/**
&lt;p&gt;Returns the text fragment's as plain text.&lt;/p&gt;

@see &lt;a href=&quot;QTextFragment.html#length()&quot;&gt;&lt;tt&gt;length&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QTextFragment.html#charFormat()&quot;&gt;&lt;tt&gt;charFormat&lt;/tt&gt;&lt;/a&gt; */"/>
</class>
