|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QTextObject
com.trolltech.qt.gui.QTextFrame
public class QTextFrame
The QTextFrame class represents a frame in a QTextDocument. Text frames provide structure for the text in a document. They are used as generic containers for other document elements. Frames are usually created by using QTextCursor::insertFrame().
Frames can be used to create hierarchical structures in rich text documents. Each document has a root frame (QTextDocument::rootFrame()), and each frame beneath the root frame has a parent frame and a (possibly empty) list of child frames. The parent frame can be found with parentFrame(), and the childFrames() function provides a list of child frames.
Each frame contains at least one text block to enable text cursors to insert new document elements within. As a result, the QTextFrame::iterator class is used to traverse both the blocks and child frames within a given frame. The first and last child elements in the frame can be found with begin() and end().
A frame also has a format (specified using QTextFrameFormat) which can be set with setFormat() and read with format().
Text cursors can be obtained that point to the first and last valid cursor positions within a frame; use the firstCursorPosition() and lastCursorPosition() functions for this. The frame's extent in the document can be found with firstPosition() and lastPosition().
You can iterate over a frame's contents using the QTextFrame::iterator class: this provides read-only access to its internal list of text blocks and child frames.
QTextCursor, and QTextDocument.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
|---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
| Constructor Summary | |
|---|---|
QTextFrame(QTextDocument doc)
Creates a new empty frame for the text document. |
|
| Method Summary | |
|---|---|
QTextFrame_iterator |
begin()
Returns an iterator pointing to the first document element inside the frame. |
java.util.List |
childFrames()
Returns a (possibly empty) list of the frame's child frames. |
QTextFrame_iterator |
end()
Returns an iterator pointing to the last document element inside the frame. |
QTextCursor |
firstCursorPosition()
Returns the first cursor position inside the frame. |
int |
firstPosition()
Returns the first document position inside the frame. |
QTextFrameFormat |
frameFormat()
Returns the frame's format. |
static QTextFrame |
fromNativePointer(QNativePointer nativePointer)
|
QTextCursor |
lastCursorPosition()
Returns the last cursor position inside the frame. |
int |
lastPosition()
Returns the last document position inside the frame. |
QTextFrame |
parentFrame()
Returns the frame's parent frame. |
void |
setFrameFormat(QTextFrameFormat format)
Sets the frame's format. |
| Methods inherited from class com.trolltech.qt.gui.QTextObject |
|---|
document, format, formatIndex, objectIndex, setFormat |
| Methods inherited from class com.trolltech.qt.core.QObject |
|---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
| 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 java.lang.Object |
|---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.trolltech.qt.QtJambiInterface |
|---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
| Constructor Detail |
|---|
public QTextFrame(QTextDocument doc)
| Method Detail |
|---|
public final QTextFrame_iterator begin()
end().
public final java.util.List childFrames()
parentFrame().
public final QTextFrame_iterator end()
begin().
public final QTextCursor firstCursorPosition()
lastCursorPosition(), firstPosition(), and lastPosition().
public final int firstPosition()
lastPosition(), firstCursorPosition(), and lastCursorPosition().
public final QTextFrameFormat frameFormat()
setFrameFormat().
public final QTextCursor lastCursorPosition()
firstCursorPosition(), firstPosition(), and lastPosition().
public final int lastPosition()
firstPosition(), firstCursorPosition(), and lastCursorPosition().
public final QTextFrame parentFrame()
childFrames(), and QTextDocument::rootFrame().
public final void setFrameFormat(QTextFrameFormat format)
frameFormat().
public static QTextFrame fromNativePointer(QNativePointer nativePointer)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||