|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.gui.QTextFragment
public class QTextFragment
The QTextFragment class holds a piece of text in a QTextDocument
with a single QTextCharFormat
. 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.
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.
text()
and charFormat()
functions. The length()
function gives the length of the text in the fragment. position()
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 contains()
function. QTextDocument
, and Rich Text Document Structure.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QTextFragment()
Creates a new empty text fragment. |
|
QTextFragment(QTextFragment o)
Copies the content (text and format) of the other text fragment to this text fragment. |
Method Summary | |
---|---|
QTextCharFormat |
charFormat()
Returns the text fragment's character format. |
int |
charFormatIndex()
Returns an index into the document's internal list of character formats for the text fragment's character format. |
QTextFragment |
clone()
This method is reimplemented for internal reasons |
boolean |
contains(int position)
Returns true if the text fragment contains the text at the given position in the document; otherwise returns false. |
boolean |
isValid()
Returns true if this is a valid text fragment (i.e. |
int |
length()
Returns the number of characters in the text fragment. |
int |
position()
Returns the position of this text fragment in the document. |
java.lang.String |
text()
Returns the text fragment's as plain text. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QTextFragment()
public QTextFragment(QTextFragment o)
Method Detail |
---|
public final QTextCharFormat charFormat()
text()
.
public final int charFormatIndex()
QTextDocument::object()
.
public final boolean contains(int position)
public final boolean isValid()
public final int length()
text()
.
public final int position()
public final java.lang.String text()
length()
, and charFormat()
.
public QTextFragment clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |