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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qabstracttextdocumentlayout.cpp -->
<title>Qt 4.8: QAbstractTextDocumentLayout Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QAbstractTextDocumentLayout</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QAbstractTextDocumentLayout Class Reference</h1>
<!-- $$$QAbstractTextDocumentLayout-brief -->
<p>The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for QTextDocuments. <a href="#details">More...</a></p>
<!-- @@@QAbstractTextDocumentLayout -->
<pre class="cpp"> <span class="preprocessor">#include <QAbstractTextDocumentLayout></span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<p><b>Inherited by: </b><a href="qplaintextdocumentlayout.html">QPlainTextDocumentLayout</a>.</p>
<p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<ul>
<li><a href="qabstracttextdocumentlayout-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout-paintcontext.html">PaintContext</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> class </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout-selection.html">Selection</a></b></td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#QAbstractTextDocumentLayout">QAbstractTextDocumentLayout</a></b> ( QTextDocument * <i>document</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#anchorAt">anchorAt</a></b> ( const QPointF & <i>position</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QRectF </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#blockBoundingRect">blockBoundingRect</a></b> ( const QTextBlock & <i>block</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextDocument * </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#document">document</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#documentSize">documentSize</a></b> () const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#draw">draw</a></b> ( QPainter * <i>painter</i>, const PaintContext & <i>context</i> ) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QRectF </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#frameBoundingRect">frameBoundingRect</a></b> ( QTextFrame * <i>frame</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextObjectInterface * </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#handlerForObject">handlerForObject</a></b> ( int <i>objectType</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#hitTest">hitTest</a></b> ( const QPointF & <i>point</i>, Qt::HitTestAccuracy <i>accuracy</i> ) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#pageCount">pageCount</a></b> () const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPaintDevice * </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#paintDevice">paintDevice</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#registerHandler">registerHandler</a></b> ( int <i>objectType</i>, QObject * <i>component</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#setPaintDevice">setPaintDevice</a></b> ( QPaintDevice * <i>device</i> )</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#documentSizeChanged">documentSizeChanged</a></b> ( const QSizeF & <i>newSize</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#pageCountChanged">pageCountChanged</a></b> ( int <i>newPages</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#update">update</a></b> ( const QRectF & <i>rect</i> = QRectF( 0., 0., 1000000000., 1000000000. ) )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#updateBlock">updateBlock</a></b> ( const QTextBlock & <i>block</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#documentChanged">documentChanged</a></b> ( int <i>position</i>, int <i>charsRemoved</i>, int <i>charsAdded</i> ) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#drawInlineObject">drawInlineObject</a></b> ( QPainter * <i>painter</i>, const QRectF & <i>rect</i>, QTextInlineObject <i>object</i>, int <i>posInDocument</i>, const QTextFormat & <i>format</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTextCharFormat </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#format">format</a></b> ( int <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#positionInlineObject">positionInlineObject</a></b> ( QTextInlineObject <i>item</i>, int <i>posInDocument</i>, const QTextFormat & <i>format</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qabstracttextdocumentlayout.html#resizeInlineObject">resizeInlineObject</a></b> ( QTextInlineObject <i>item</i>, int <i>posInDocument</i>, const QTextFormat & <i>format</i> )</td></tr>
</table>
<ul>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QAbstractTextDocumentLayout-description -->
<div class="descr">
<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 images, 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 custom layout behavior for your text documents.</p>
<p>An instance of the QAbstractTextDocumentLayout subclass can be installed on a <a href="qtextdocument.html">QTextDocument</a> object with the <a href="qtextdocument.html#setDocumentLayout">setDocumentLayout()</a> function.</p>
<p>You can insert custom objects into a <a href="qtextdocument.html">QTextDocument</a>; see the <a href="qtextobjectinterface.html">QTextObjectInterface</a> class description for details.</p>
</div>
<p><b>See also </b><a href="qtextobjectinterface.html">QTextObjectInterface</a>.</p>
<!-- @@@QAbstractTextDocumentLayout -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAbstractTextDocumentLayout[overload1]$$$QAbstractTextDocumentLayoutQTextDocument* -->
<h3 class="fn"><a name="QAbstractTextDocumentLayout"></a>QAbstractTextDocumentLayout::<span class="name">QAbstractTextDocumentLayout</span> ( <span class="type"><a href="qtextdocument.html">QTextDocument</a></span> * <i>document</i> )</h3>
<p>Creates a new text document layout for the given <i>document</i>.</p>
<!-- @@@QAbstractTextDocumentLayout -->
<!-- $$$anchorAt[overload1]$$$anchorAtconstQPointF& -->
<h3 class="fn"><a name="anchorAt"></a><span class="type"><a href="qstring.html">QString</a></span> QAbstractTextDocumentLayout::<span class="name">anchorAt</span> ( const <span class="type"><a href="qpointf.html">QPointF</a></span> & <i>position</i> ) const</h3>
<p>Returns the reference of the anchor the given <i>position</i>, or an empty string if no anchor exists at that point.</p>
<!-- @@@anchorAt -->
<!-- $$$blockBoundingRect[overload1]$$$blockBoundingRectconstQTextBlock& -->
<h3 class="fn"><a name="blockBoundingRect"></a><span class="type"><a href="qrectf.html">QRectF</a></span> QAbstractTextDocumentLayout::<span class="name">blockBoundingRect</span> ( const <span class="type"><a href="qtextblock.html">QTextBlock</a></span> & <i>block</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the bounding rectangle of <i>block</i>.</p>
<!-- @@@blockBoundingRect -->
<!-- $$$document[overload1]$$$document -->
<h3 class="fn"><a name="document"></a><span class="type"><a href="qtextdocument.html">QTextDocument</a></span> * QAbstractTextDocumentLayout::<span class="name">document</span> () const</h3>
<p>Returns the text document that this layout is operating on.</p>
<!-- @@@document -->
<!-- $$$documentChanged[overload1]$$$documentChangedintintint -->
<h3 class="fn"><a name="documentChanged"></a><span class="type">void</span> QAbstractTextDocumentLayout::<span class="name">documentChanged</span> ( <span class="type">int</span> <i>position</i>, <span class="type">int</span> <i>charsRemoved</i>, <span class="type">int</span> <i>charsAdded</i> )<tt> [pure virtual protected]</tt></h3>
<p>This function is called whenever the contents of the document change. A change occurs when text is inserted, removed, or a combination of these two. 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 characters 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 a combination of removing and inserting. For example, if the text "Hello" gets replaced by "Hi", <i>charsRemoved</i> would be 5 and <i>charsAdded</i> would be 2.</p>
<p>For subclasses of <a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a>, this is the central function where a large portion of the work to lay out and position document contents is done.</p>
<p>For example, in a subclass that only arranges blocks of text, an implementation of this function would have to do the following:</p>
<ul>
<li>Determine the list of changed <a href="qtextblock.html">QTextBlock</a>(s) using the parameters provided.</li>
<li>Each <a href="qtextblock.html">QTextBlock</a> object's corresponding <a href="qtextlayout.html">QTextLayout</a> object needs to be processed. You can access the <a href="qtextblock.html">QTextBlock</a>'s layout using the <a href="qtextblock.html#layout">QTextBlock::layout</a>() function. This processing should take the document's page size into consideration.</li>
<li>If the total number of pages changed, the <a href="qabstracttextdocumentlayout.html#pageCountChanged">pageCountChanged</a>() signal should be emitted.</li>
<li>If the total size changed, the <a href="qabstracttextdocumentlayout.html#documentSizeChanged">documentSizeChanged</a>() signal should be emitted.</li>
<li>The <a href="qabstracttextdocumentlayout.html#update">update</a>() signal should be emitted to schedule a repaint of areas in the layout that require repainting.</li>
</ul>
<p><b>See also </b><a href="qtextlayout.html">QTextLayout</a>.</p>
<!-- @@@documentChanged -->
<!-- $$$documentSize[overload1]$$$documentSize -->
<h3 class="fn"><a name="documentSize"></a><span class="type"><a href="qsizef.html">QSizeF</a></span> QAbstractTextDocumentLayout::<span class="name">documentSize</span> () const<tt> [pure virtual]</tt></h3>
<p>Returns the total size of the document's layout.</p>
<p>This information can be used by display widgets to update their scroll bars correctly.</p>
<p><b>See also </b><a href="qabstracttextdocumentlayout.html#documentSizeChanged">documentSizeChanged</a>() and <a href="qtextdocument.html#pageSize-prop">QTextDocument::pageSize</a>.</p>
<!-- @@@documentSize -->
<!-- $$$documentSizeChanged[overload1]$$$documentSizeChangedconstQSizeF& -->
<h3 class="fn"><a name="documentSizeChanged"></a><span class="type">void</span> QAbstractTextDocumentLayout::<span class="name">documentSizeChanged</span> ( const <span class="type"><a href="qsizef.html">QSizeF</a></span> & <i>newSize</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the size of the document layout changes to <i>newSize</i>.</p>
<p>Subclasses of <a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a> should emit this signal when the document's entire layout size changes. This signal is useful for widgets that display text documents since it enables them to update their scroll bars correctly.</p>
<p><b>See also </b><a href="qabstracttextdocumentlayout.html#documentSize">documentSize</a>().</p>
<!-- @@@documentSizeChanged -->
<!-- $$$draw[overload1]$$$drawQPainter*constPaintContext& -->
<h3 class="fn"><a name="draw"></a><span class="type">void</span> QAbstractTextDocumentLayout::<span class="name">draw</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, const <span class="type"><a href="qabstracttextdocumentlayout-paintcontext.html">PaintContext</a></span> & <i>context</i> )<tt> [pure virtual]</tt></h3>
<p>Draws the layout with the given <i>painter</i> using the given <i>context</i>.</p>
<!-- @@@draw -->
<!-- $$$drawInlineObject[overload1]$$$drawInlineObjectQPainter*constQRectF&QTextInlineObjectintconstQTextFormat& -->
<h3 class="fn"><a name="drawInlineObject"></a><span class="type">void</span> QAbstractTextDocumentLayout::<span class="name">drawInlineObject</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, const <span class="type"><a href="qrectf.html">QRectF</a></span> & <i>rect</i>, <span class="type"><a href="qtextinlineobject.html">QTextInlineObject</a></span> <i>object</i>, <span class="type">int</span> <i>posInDocument</i>, const <span class="type"><a href="qtextformat.html">QTextFormat</a></span> & <i>format</i> )<tt> [virtual protected]</tt></h3>
<p>This function is called to draw the inline object, <i>object</i>, with the given <i>painter</i> within the rectangle specified by <i>rect</i> using the specified text <i>format</i>.</p>
<p><i>posInDocument</i> specifies the position of the object within the document.</p>
<p>The default implementation calls drawObject() on the object handlers. This function is called only within Qt. Subclasses can reimplement this function to customize the drawing of inline objects.</p>
<p><b>See also </b><a href="qabstracttextdocumentlayout.html#draw">draw</a>().</p>
<!-- @@@drawInlineObject -->
<!-- $$$format[overload1]$$$formatint -->
<h3 class="fn"><a name="format"></a><span class="type"><a href="qtextcharformat.html">QTextCharFormat</a></span> QAbstractTextDocumentLayout::<span class="name">format</span> ( <span class="type">int</span> <i>position</i> )<tt> [protected]</tt></h3>
<p>Returns the character format that is applicable at the given <i>position</i>.</p>
<!-- @@@format -->
<!-- $$$frameBoundingRect[overload1]$$$frameBoundingRectQTextFrame* -->
<h3 class="fn"><a name="frameBoundingRect"></a><span class="type"><a href="qrectf.html">QRectF</a></span> QAbstractTextDocumentLayout::<span class="name">frameBoundingRect</span> ( <span class="type"><a href="qtextframe.html">QTextFrame</a></span> * <i>frame</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the bounding rectangle of <i>frame</i>.</p>
<!-- @@@frameBoundingRect -->
<!-- $$$handlerForObject[overload1]$$$handlerForObjectint -->
<h3 class="fn"><a name="handlerForObject"></a><span class="type"><a href="qtextobjectinterface.html">QTextObjectInterface</a></span> * QAbstractTextDocumentLayout::<span class="name">handlerForObject</span> ( <span class="type">int</span> <i>objectType</i> ) const</h3>
<p>Returns a handler for objects of the given <i>objectType</i>.</p>
<!-- @@@handlerForObject -->
<!-- $$$hitTest[overload1]$$$hitTestconstQPointF&Qt::HitTestAccuracy -->
<h3 class="fn"><a name="hitTest"></a><span class="type">int</span> QAbstractTextDocumentLayout::<span class="name">hitTest</span> ( const <span class="type"><a href="qpointf.html">QPointF</a></span> & <i>point</i>, <span class="type"><a href="qt.html#HitTestAccuracy-enum">Qt::HitTestAccuracy</a></span> <i>accuracy</i> ) const<tt> [pure virtual]</tt></h3>
<p>Returns the cursor postion for the given <i>point</i> with the specified <i>accuracy</i>. Returns -1 if no valid cursor position was found.</p>
<!-- @@@hitTest -->
<!-- $$$pageCount[overload1]$$$pageCount -->
<h3 class="fn"><a name="pageCount"></a><span class="type">int</span> QAbstractTextDocumentLayout::<span class="name">pageCount</span> () const<tt> [pure virtual]</tt></h3>
<p>Returns the number of pages contained in the layout.</p>
<p><b>See also </b><a href="qabstracttextdocumentlayout.html#pageCountChanged">pageCountChanged</a>().</p>
<!-- @@@pageCount -->
<!-- $$$pageCountChanged[overload1]$$$pageCountChangedint -->
<h3 class="fn"><a name="pageCountChanged"></a><span class="type">void</span> QAbstractTextDocumentLayout::<span class="name">pageCountChanged</span> ( <span class="type">int</span> <i>newPages</i> )<tt> [signal]</tt></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>Subclasses of <a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a> should emit this signal when the number of pages in the layout has changed. Changes to the page count are caused by changes to the layout or the document content itself.</p>
<p><b>See also </b><a href="qabstracttextdocumentlayout.html#pageCount">pageCount</a>().</p>
<!-- @@@pageCountChanged -->
<!-- $$$paintDevice[overload1]$$$paintDevice -->
<h3 class="fn"><a name="paintDevice"></a><span class="type"><a href="qpaintdevice.html">QPaintDevice</a></span> * QAbstractTextDocumentLayout::<span class="name">paintDevice</span> () const</h3>
<p>Returns the paint device used to render the document's layout.</p>
<p><b>See also </b><a href="qabstracttextdocumentlayout.html#setPaintDevice">setPaintDevice</a>().</p>
<!-- @@@paintDevice -->
<!-- $$$positionInlineObject[overload1]$$$positionInlineObjectQTextInlineObjectintconstQTextFormat& -->
<h3 class="fn"><a name="positionInlineObject"></a><span class="type">void</span> QAbstractTextDocumentLayout::<span class="name">positionInlineObject</span> ( <span class="type"><a href="qtextinlineobject.html">QTextInlineObject</a></span> <i>item</i>, <span class="type">int</span> <i>posInDocument</i>, const <span class="type"><a href="qtextformat.html">QTextFormat</a></span> & <i>format</i> )<tt> [virtual protected]</tt></h3>
<p>Lays out the inline object <i>item</i> using the given text <i>format</i>.</p>
<p><i>posInDocument</i> specifies the position of the object within the document.</p>
<p>The default implementation does nothing. This function is called only within Qt. Subclasses can reimplement this function to customize the position of inline objects.</p>
<p><b>See also </b><a href="qabstracttextdocumentlayout.html#drawInlineObject">drawInlineObject</a>().</p>
<!-- @@@positionInlineObject -->
<!-- $$$registerHandler[overload1]$$$registerHandlerintQObject* -->
<h3 class="fn"><a name="registerHandler"></a><span class="type">void</span> QAbstractTextDocumentLayout::<span class="name">registerHandler</span> ( <span class="type">int</span> <i>objectType</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>component</i> )</h3>
<p>Registers the given <i>component</i> as a handler for items of the given <i>objectType</i>.</p>
<p><b>Note:</b> registerHandler() has to be called once for each object type. This means that there is only one handler for multiple replacement characters of the same object type.</p>
<!-- @@@registerHandler -->
<!-- $$$resizeInlineObject[overload1]$$$resizeInlineObjectQTextInlineObjectintconstQTextFormat& -->
<h3 class="fn"><a name="resizeInlineObject"></a><span class="type">void</span> QAbstractTextDocumentLayout::<span class="name">resizeInlineObject</span> ( <span class="type"><a href="qtextinlineobject.html">QTextInlineObject</a></span> <i>item</i>, <span class="type">int</span> <i>posInDocument</i>, const <span class="type"><a href="qtextformat.html">QTextFormat</a></span> & <i>format</i> )<tt> [virtual protected]</tt></h3>
<p>Sets the size of the inline object <i>item</i> corresponding to the text <i>format</i>.</p>
<p><i>posInDocument</i> specifies the position of the object within the document.</p>
<p>The default implementation resizes the <i>item</i> to the size returned by the object handler's intrinsicSize() function. This function is called only within Qt. Subclasses can reimplement this function to customize the resizing of inline objects.</p>
<!-- @@@resizeInlineObject -->
<!-- $$$setPaintDevice[overload1]$$$setPaintDeviceQPaintDevice* -->
<h3 class="fn"><a name="setPaintDevice"></a><span class="type">void</span> QAbstractTextDocumentLayout::<span class="name">setPaintDevice</span> ( <span class="type"><a href="qpaintdevice.html">QPaintDevice</a></span> * <i>device</i> )</h3>
<p>Sets the paint device used for rendering the document's layout to the given <i>device</i>.</p>
<p><b>See also </b><a href="qabstracttextdocumentlayout.html#paintDevice">paintDevice</a>().</p>
<!-- @@@setPaintDevice -->
<!-- $$$update[overload1]$$$updateconstQRectF& -->
<h3 class="fn"><a name="update"></a><span class="type">void</span> QAbstractTextDocumentLayout::<span class="name">update</span> ( const <span class="type"><a href="qrectf.html">QRectF</a></span> & <i>rect</i> = QRectF( 0., 0., 1000000000., 1000000000. ) )<tt> [signal]</tt></h3>
<p>This signal is emitted when the rectangle <i>rect</i> has been updated.</p>
<p>Subclasses of <a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a> should emit this signal when the layout of the contents change in order to repaint.</p>
<!-- @@@update -->
<!-- $$$updateBlock[overload1]$$$updateBlockconstQTextBlock& -->
<h3 class="fn"><a name="updateBlock"></a><span class="type">void</span> QAbstractTextDocumentLayout::<span class="name">updateBlock</span> ( const <span class="type"><a href="qtextblock.html">QTextBlock</a></span> & <i>block</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the specified <i>block</i> has been updated.</p>
<p>Subclasses of <a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a> should emit this signal when the layout of <i>block</i> has changed in order to repaint.</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@updateBlock -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|