Home | All Classes | Main Classes | Annotated | Grouped Classes | 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 name of the anchor at the given position, or an empty string if no anchor exists at that point.
Returns the text document that this layout is operating on.
This function is called whenever the contents of the document change. A change is an insertion of text, text removal, or the combination of both. The from argument defines the beginning of the change in the document. The oldLength argument specifies the length of the area that was modified before the actual change, and length is the length afterwards.
For example when simply inserting the text "Hello", oldLength would be 0 and length would equal 5 (the length of the string).
If for example 3 characters get removed, then oldLength would be equal to 3 while length would be 0, as before the change there were 3 characters and afterwards none.
Replacing text is the combination of removal and insertion. For example, if the text "Hello" gets replaced by "Hi", oldLength would be 5 and length would be 2.
Draws the layout on the given painter with the given context.
Called to draw the inline object item on the given painter within the rectangle specified by rect using the given text format and selection type selType.
See also layoutObject().
Returns the character format that is applicable at the given position.
Lays out the inline object item using the given text format. The base class implementation does nothing.
See also drawObject().
Returns the number of pages required by this layout; this depends in part on the pageSize().
Returns the page size.
See also setPageSize() and numPages().
Sets the page size.
See also pageSize() and numPages().
Sets the size of the inline object item in accordance with the text format.
Returns the size used for the document. The default implementation just calls pageSize(). For example, if your layout is similar to HTML then you may want to re-implement this function, and return the size your document actually used, as that will differ from the page size.
See also setPageSize() and pageSize().
This signal is emitted when the rectangle rect has been updated.
Copyright © 2004 Trolltech. | Trademarks | Qt 4.0.0-tp1 |