Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |
The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for QTextDocuments. More...
#include <QAbstractTextDocumentLayout>
Inherits QObject.
The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for QTextDocuments.
The standard layout provided by Qt can handle simple word processing including inline layouts, lists and tables.
Some applications (e.g. a word processor or a DTP application) might need more features than the ones provided by Qt's layout engine, in which case you can subclass QAbstractTextDocumentLayout to provide your own custom layout behavior for your text documents.
Creates a new text document layout for the given document.
Returns the reference of the anchor at the given position, or an empty string if no anchor exists at that point.
Returns the bounding rectangle of block.
Returns the text document that this layout is operating on.
This function is called whenever the contents of the document change. A change occurs when text is inserted, removed, or a combination of the two types of operation. The change is specified by position, charsRemoved, and charsAdded corresponding to the starting character position of the change, the number of character removed from the document, and the number of characters added.
For example, when inserting the text "Hello" into an empty document, charsRemoved would be 0 and charsAdded would be 5 (the length of the string).
Replacing text is the combination of removal and insertion. For example, if the text "Hello" gets replaced by "Hi", charsRemoved would be 5 and charsAdded would be 2.
Returns the total size of the document. This is useful to display widgets since they can use to information to update their scroll bars correctly
See also documentSizeChanged() and QTextDocument::pageSize.
This signal is emitted when the size of the document changes. The new size is specified by newSize.
This information is useful to widgets that display text documents since it enables them to update their scroll bars correctly.
See also documentSize().
Draws the layout on the given painter with the given context.
Called to draw the inline object object on the given painter within the rectangle specified by rect using the text format specified by format.
See also draw().
Returns the character format that is applicable at the given position.
Returns the bounding rectacle of frame. Returns the bounding rectangle of frame.
Returns a handler for objects of the given objectType.
Returns the number of pages required by the layout.
See also pageCountChanged().
This signal is emitted when the number of pages in the layout changes; newPages is the updated page count.
Changes to the page count are due to the changes to the layout or the document content itself.
See also pageCount().
Returns the paint device used to render the document's layout.
See also setPaintDevice().
Lays out the inline object item using the given text format. The base class implementation does nothing.
See also drawInlineObject().
Registers the given component as a handler for items of the given formatType.
Sets the size of the inline object item in accordance with the text format.
Sets the paint device used for rendering the document's layout to the given device.
See also paintDevice().
This signal is emitted when the rectangle rect has been updated.
Copyright © 2005 Trolltech | Trademarks | Qt 4.1.0 |