File: qabstracttextdocumentlayout.html

package info (click to toggle)
python-qt4 4.0.1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 18,632 kB
  • ctags: 2,639
  • sloc: python: 29,409; sh: 5,646; cpp: 3,168; xml: 149; makefile: 109
file content (44 lines) | stat: -rw-r--r-- 13,544 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QAbstractTextDocumentLayout Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QAbstractTextDocumentLayout Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for QTextDocuments. <a href="#details">More...</a></p>
<p>Inherits <a href="qobject.html">QObject</a>.</p><h3>Types</h3><ul><li><div class="fn" />class <b><a href="qabstracttextdocumentlayout-paintcontext.html">PaintContext</a></b></li><li><div class="fn" />class <b><a href="qabstracttextdocumentlayout-selection.html">Selection</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qabstracttextdocumentlayout.html#QAbstractTextDocumentLayout">__init__</a></b> (<i>self</i>, QTextDocument&#160;<i>doc</i>)</li><li><div class="fn" />QString <b><a href="qabstracttextdocumentlayout.html#anchorAt">anchorAt</a></b> (<i>self</i>, QPointF&#160;<i>pos</i>)</li><li><div class="fn" />QRectF <b><a href="qabstracttextdocumentlayout.html#blockBoundingRect">blockBoundingRect</a></b> (<i>self</i>, QTextBlock&#160;<i>block</i>)</li><li><div class="fn" />QTextDocument <b><a href="qabstracttextdocumentlayout.html#document">document</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstracttextdocumentlayout.html#documentChanged">documentChanged</a></b> (<i>self</i>, int&#160;<i>from</i>, int&#160;<i>charsRemoved</i>, int&#160;<i>charsAdded</i>)</li><li><div class="fn" />QSizeF <b><a href="qabstracttextdocumentlayout.html#documentSize">documentSize</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstracttextdocumentlayout.html#draw">draw</a></b> (<i>self</i>, QPainter&#160;<i>painter</i>, PaintContext&#160;<i>context</i>)</li><li><div class="fn" /><b><a href="qabstracttextdocumentlayout.html#drawInlineObject">drawInlineObject</a></b> (<i>self</i>, QPainter&#160;<i>painter</i>, QRectF&#160;<i>rect</i>, QTextInlineObject&#160;<i>object</i>, int&#160;<i>posInDocument</i>, QTextFormat&#160;<i>format</i>)</li><li><div class="fn" />QTextCharFormat <b><a href="qabstracttextdocumentlayout.html#format">format</a></b> (<i>self</i>, int&#160;<i>pos</i>)</li><li><div class="fn" />QRectF <b><a href="qabstracttextdocumentlayout.html#frameBoundingRect">frameBoundingRect</a></b> (<i>self</i>, QTextFrame&#160;<i>frame</i>)</li><li><div class="fn" />int <b><a href="qabstracttextdocumentlayout.html#hitTest">hitTest</a></b> (<i>self</i>, QPointF&#160;<i>point</i>, Qt.HitTestAccuracy&#160;<i>accuracy</i>)</li><li><div class="fn" />int <b><a href="qabstracttextdocumentlayout.html#pageCount">pageCount</a></b> (<i>self</i>)</li><li><div class="fn" />QPaintDevice <b><a href="qabstracttextdocumentlayout.html#paintDevice">paintDevice</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qabstracttextdocumentlayout.html#positionInlineObject">positionInlineObject</a></b> (<i>self</i>, QTextInlineObject&#160;<i>item</i>, int&#160;<i>posInDocument</i>, QTextFormat&#160;<i>format</i>)</li><li><div class="fn" /><b><a href="qabstracttextdocumentlayout.html#resizeInlineObject">resizeInlineObject</a></b> (<i>self</i>, QTextInlineObject&#160;<i>item</i>, int&#160;<i>posInDocument</i>, QTextFormat&#160;<i>format</i>)</li><li><div class="fn" /><b><a href="qabstracttextdocumentlayout.html#setPaintDevice">setPaintDevice</a></b> (<i>self</i>, QPaintDevice&#160;<i>device</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qabstracttextdocumentlayout.html#documentSizeChanged">documentSizeChanged</a></b> (const QSizeF&amp;)</li><li><div class="fn" />void <b><a href="qabstracttextdocumentlayout.html#pageCountChanged">pageCountChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="qabstracttextdocumentlayout.html#update">update</a></b> (const QRectF&amp; = QRectF(0,0,1e+09,1e+09))</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for QTextDocuments.</p>
<p>The standard layout provided by Qt can handle simple word processing including inline layouts, lists and tables.</p>
<p>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.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QAbstractTextDocumentLayout" />QAbstractTextDocumentLayout.__init__ (<i>self</i>, <a href="qtextdocument.html">QTextDocument</a>&#160;<i>doc</i>)</h3><p>Creates a new text document layout for the given <i>document</i>.</p>
<h3 class="fn"><a name="anchorAt" /><a href="qstring.html">QString</a> QAbstractTextDocumentLayout.anchorAt (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>pos</i>)</h3><p>Returns the reference of the anchor at the given <i>position</i>, or an empty string if no anchor exists at that point.</p>
<h3 class="fn"><a name="blockBoundingRect" /><a href="qrectf.html">QRectF</a> QAbstractTextDocumentLayout.blockBoundingRect (<i>self</i>, <a href="qtextblock.html">QTextBlock</a>&#160;<i>block</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the bounding rectangle of <i>block</i>.</p>
<h3 class="fn"><a name="document" /><a href="qtextdocument.html">QTextDocument</a> QAbstractTextDocumentLayout.document (<i>self</i>)</h3><p>Returns the text document that this layout is operating on.</p>
<h3 class="fn"><a name="documentChanged" />QAbstractTextDocumentLayout.documentChanged (<i>self</i>, int&#160;<i>from</i>, int&#160;<i>charsRemoved</i>, int&#160;<i>charsAdded</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>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 <i>position</i>, <i>charsRemoved</i>, and <i>charsAdded</i> corresponding to the starting character position of the change, the number of character removed from the document, and the number of characters added.</p>
<p>For example, when inserting the text "Hello" into an empty document, <i>charsRemoved</i> would be 0 and <i>charsAdded</i> would be 5 (the length of the string).</p>
<p>Replacing text is the combination of removal and insertion. For example, if the text "Hello" gets replaced by "Hi", <i>charsRemoved</i> would be 5 and <i>charsAdded</i> would be 2.</p>
<h3 class="fn"><a name="documentSize" /><a href="qsizef.html">QSizeF</a> QAbstractTextDocumentLayout.documentSize (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>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</p>
<p>See also <a href="qabstracttextdocumentlayout.html#documentSizeChanged">documentSizeChanged</a>() and <a href="qtextdocument.html#pageSize-prop">QTextDocument.pageSize</a>.</p>
<h3 class="fn"><a name="draw" />QAbstractTextDocumentLayout.draw (<i>self</i>, <a href="qpainter.html">QPainter</a>&#160;<i>painter</i>, <a href="qabstracttextdocumentlayout-paintcontext.html">PaintContext</a>&#160;<i>context</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Draws the layout on the given <i>painter</i> with the given <i>context</i>.</p>
<h3 class="fn"><a name="drawInlineObject" />QAbstractTextDocumentLayout.drawInlineObject (<i>self</i>, <a href="qpainter.html">QPainter</a>&#160;<i>painter</i>, <a href="qrectf.html">QRectF</a>&#160;<i>rect</i>, <a href="qtextinlineobject.html">QTextInlineObject</a>&#160;<i>object</i>, int&#160;<i>posInDocument</i>, <a href="qtextformat.html">QTextFormat</a>&#160;<i>format</i>)</h3><p>Called to draw the inline object <i>object</i> on the given <i>painter</i> within the rectangle specified by <i>rect</i> using the text format specified by <i>format</i>.</p>
<p>See also <a href="qabstracttextdocumentlayout.html#draw">draw</a>().</p>
<h3 class="fn"><a name="format" /><a href="qtextcharformat.html">QTextCharFormat</a> QAbstractTextDocumentLayout.format (<i>self</i>, int&#160;<i>pos</i>)</h3><p>Returns the character format that is applicable at the given <i>position</i>.</p>
<h3 class="fn"><a name="frameBoundingRect" /><a href="qrectf.html">QRectF</a> QAbstractTextDocumentLayout.frameBoundingRect (<i>self</i>, <a href="qtextframe.html">QTextFrame</a>&#160;<i>frame</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the bounding rectacle of <i>frame</i>. Returns the bounding rectangle of <i>frame</i>.</p>
<h3 class="fn"><a name="hitTest" />int QAbstractTextDocumentLayout.hitTest (<i>self</i>, <a href="qpointf.html">QPointF</a>&#160;<i>point</i>, <a href="qt.html#HitTestAccuracy-enum">Qt.HitTestAccuracy</a>&#160;<i>accuracy</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the cursor postion for the given <i>point</i> with the <i>accuracy</i> specified. Returns -1 to indicate failure if no valid cursor position was found.</p>
<h3 class="fn"><a name="pageCount" />int QAbstractTextDocumentLayout.pageCount (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the number of pages required by the layout.</p>
<p>See also <a href="qabstracttextdocumentlayout.html#pageCountChanged">pageCountChanged</a>().</p>
<h3 class="fn"><a name="paintDevice" /><a href="qpaintdevice.html">QPaintDevice</a> QAbstractTextDocumentLayout.paintDevice (<i>self</i>)</h3><p>Returns the paint device used to render the document's layout.</p>
<p>See also <a href="qabstracttextdocumentlayout.html#setPaintDevice">setPaintDevice</a>().</p>
<h3 class="fn"><a name="positionInlineObject" />QAbstractTextDocumentLayout.positionInlineObject (<i>self</i>, <a href="qtextinlineobject.html">QTextInlineObject</a>&#160;<i>item</i>, int&#160;<i>posInDocument</i>, <a href="qtextformat.html">QTextFormat</a>&#160;<i>format</i>)</h3><p>Lays out the inline object <i>item</i> using the given text <i>format</i>. The base class implementation does nothing.</p>
<p>See also <a href="qabstracttextdocumentlayout.html#drawInlineObject">drawInlineObject</a>().</p>
<h3 class="fn"><a name="resizeInlineObject" />QAbstractTextDocumentLayout.resizeInlineObject (<i>self</i>, <a href="qtextinlineobject.html">QTextInlineObject</a>&#160;<i>item</i>, int&#160;<i>posInDocument</i>, <a href="qtextformat.html">QTextFormat</a>&#160;<i>format</i>)</h3><p>Sets the size of the inline object <i>item</i> in accordance with the text <i>format</i>.</p>
<h3 class="fn"><a name="setPaintDevice" />QAbstractTextDocumentLayout.setPaintDevice (<i>self</i>, <a href="qpaintdevice.html">QPaintDevice</a>&#160;<i>device</i>)</h3><p>Sets the paint device used for rendering the document's layout to the given <i>device</i>.</p>
<p>See also <a href="qabstracttextdocumentlayout.html#paintDevice">paintDevice</a>().</p>
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="documentSizeChanged" />void documentSizeChanged (const QSizeF&amp;)</h3><p>This signal is emitted when the size of the document changes. The new size is specified by <i>newSize</i>.</p>
<p>This information is useful to widgets that display text documents since it enables them to update their scroll bars correctly.</p>
<p>See also <a href="qabstracttextdocumentlayout.html#documentSize">documentSize</a>().</p>
<h3 class="fn"><a name="pageCountChanged" />void pageCountChanged (int)</h3><p>This signal is emitted when the number of pages in the layout changes; <i>newPages</i> is the updated page count.</p>
<p>Changes to the page count are due to the changes to the layout or the document content itself.</p>
<p>See also <a href="qabstracttextdocumentlayout.html#pageCount">pageCount</a>().</p>
<h3 class="fn"><a name="update" />void update (const QRectF&amp; = QRectF (0,0,1e+09,1e+09))</h3><p>This signal is emitted when the rectangle <i>rect</i> has been updated.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt&#160;4.0.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.trolltech.com">Trolltech&#160;AS</a> 2006</td><td align="right" width="25%">Qt&#160;4.1.4</td></tr></table></div></address></body></html>