Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions | ![]() |
The QTextFragment class holds a piece of text in a QTextDocument that has a single QTextCharFormat. More...
#include <QTextFragment>
The QTextFragment class holds a piece of text in a QTextDocument that has a single QTextCharFormat.
If the user edits the text in a fragment, for example, makes a word in the middle bold, the fragment will be broken into three separate fragments, the first and third with the same format as before and containing the text before and after the emboldened word, and the second with a bold font and the emboldened word.
A text fragment can be queried for its text(), charFormat(), length() and position(), and for whether it contains() a particular position in the document as a whole.
Creates a new empty text fragment.
Copies the content (text and format) of the other text fragment to this text fragment.
Returns the text fragment's character format.
See also text().
Returns true if the text fragment contains the text at the given position in the document; otherwise returns false.
Returns true if this is a valid text fragment (i.e. has a valid position in a document); otherwise returns false.
Returns the number of characters in the text fragment.
See also text().
Returns the position of this text fragment in the document.
Returns the text fragment's text.
See also length() and charFormat().
Returns true if this text fragment is different (at a different position) from the other text fragment; otherwise returns false.
Returns true if this text fragment appears earlier in the document than the other text fragment; otherwise returns false.
Assigns the content (text and format) of the other text fragment to this text fragment.
Returns true if this text fragment is the same (at the same position) as the other text fragment; otherwise returns false.
Copyright © 2004 Trolltech. | Trademarks | Qt 4.0.0-tp1 |