<?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" /> <!-- qtextobject.cpp --> <title>Qt 4.8: QTextFrame Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <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>QTextFrame</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></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="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QTextFrame Class Reference</h1> <!-- $$$QTextFrame-brief --> <p>The QTextFrame class represents a frame in a <a href="qtextdocument.html">QTextDocument</a>. <a href="#details">More...</a></p> <!-- @@@QTextFrame --> <pre class="cpp"> <span class="preprocessor">#include <QTextFrame></span></pre><p><b>Inherits: </b><a href="qtextobject.html">QTextObject</a>.</p> <p><b>Inherited by: </b><a href="qtexttable.html">QTextTable</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="qtextframe-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="qtextframe-iterator.html">iterator</a></b></td></tr> <tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#Iterator-typedef">Iterator</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="qtextframe.html#QTextFrame">QTextFrame</a></b> ( QTextDocument * <i>document</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#dtor.QTextFrame">~QTextFrame</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> iterator </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#begin">begin</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QList<QTextFrame *> </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#childFrames">childFrames</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> iterator </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#end">end</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QTextCursor </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#firstCursorPosition">firstCursorPosition</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#firstPosition">firstPosition</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QTextFrameFormat </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#frameFormat">frameFormat</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QTextCursor </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#lastCursorPosition">lastCursorPosition</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#lastPosition">lastPosition</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QTextFrame * </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#parentFrame">parentFrame</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextframe.html#setFrameFormat">setFrameFormat</a></b> ( const QTextFrameFormat & <i>format</i> )</td></tr> </table> <ul> <li class="fn">4 public functions inherited from <a href="qtextobject.html#public-functions">QTextObject</a></li> <li class="fn">29 public functions inherited from <a href="qobject.html#public-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">1 signal inherited from <a href="qobject.html#signals">QObject</a></li> <li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li> <li class="fn">1 protected function inherited from <a href="qtextobject.html#protected-functions">QTextObject</a></li> <li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> </ul> <a name="details"></a> <!-- $$$QTextFrame-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QTextFrame class represents a frame in a <a href="qtextdocument.html">QTextDocument</a>.</p> <p>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 <a href="qtextcursor.html#insertFrame">QTextCursor::insertFrame</a>().</p> <p>Frames can be used to create hierarchical structures in rich text documents. Each document has a root frame (<a href="qtextdocument.html#rootFrame">QTextDocument::rootFrame</a>()), 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 <a href="qtextframe.html#parentFrame">parentFrame</a>(), and the <a href="qtextframe.html#childFrames">childFrames</a>() function provides a list of child frames.</p> <p>Each frame contains at least one text block to enable text cursors to insert new document elements within. As a result, the <a href="qtextframe-iterator.html">QTextFrame::iterator</a> 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 <a href="qtextframe.html#begin">begin</a>() and <a href="qtextframe.html#end">end</a>().</p> <p>A frame also has a format (specified using <a href="qtextframeformat.html">QTextFrameFormat</a>) which can be set with <a href="qtextobject.html#setFormat">setFormat</a>() and read with <a href="qtextobject.html#format">format</a>().</p> <p>Text cursors can be obtained that point to the first and last valid cursor positions within a frame; use the <a href="qtextframe.html#firstCursorPosition">firstCursorPosition</a>() and <a href="qtextframe.html#lastCursorPosition">lastCursorPosition</a>() functions for this. The frame's extent in the document can be found with <a href="qtextframe.html#firstPosition">firstPosition</a>() and <a href="qtextframe.html#lastPosition">lastPosition</a>().</p> <p>You can iterate over a frame's contents using the <a href="qtextframe-iterator.html">QTextFrame::iterator</a> class: this provides read-only access to its internal list of text blocks and child frames.</p> </div> <p><b>See also </b><a href="qtextcursor.html">QTextCursor</a> and <a href="qtextdocument.html">QTextDocument</a>.</p> <!-- @@@QTextFrame --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$Iterator --> <h3 class="fn"><a name="Iterator-typedef"></a>typedef QTextFrame::<span class="name">Iterator</span></h3> <p>Qt-style synonym for <a href="qtextframe-iterator.html">QTextFrame::iterator</a>.</p> <!-- @@@Iterator --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QTextFrame[overload1]$$$QTextFrameQTextDocument* --> <h3 class="fn"><a name="QTextFrame"></a>QTextFrame::<span class="name">QTextFrame</span> ( <span class="type"><a href="qtextdocument.html">QTextDocument</a></span> * <i>document</i> )</h3> <p>Creates a new empty frame for the text <i>document</i>.</p> <!-- @@@QTextFrame --> <!-- $$$~QTextFrame[overload1]$$$~QTextFrame --> <h3 class="fn"><a name="dtor.QTextFrame"></a>QTextFrame::<span class="name">~QTextFrame</span> ()</h3> <p>Destroys the frame, and removes it from the document's layout.</p> <!-- @@@~QTextFrame --> <!-- $$$begin[overload1]$$$begin --> <h3 class="fn"><a name="begin"></a><span class="type"><a href="qtextframe-iterator.html">iterator</a></span> QTextFrame::<span class="name">begin</span> () const</h3> <p>Returns an iterator pointing to the first document element inside the frame. Please see the document <a href="containers.html#stl-style-iterators">STL-style-Iterators</a> for more information.</p> <p><b>See also </b><a href="qtextframe.html#end">end</a>().</p> <!-- @@@begin --> <!-- $$$childFrames[overload1]$$$childFrames --> <h3 class="fn"><a name="childFrames"></a><span class="type"><a href="qlist.html">QList</a></span><<span class="type">QTextFrame</span> *> QTextFrame::<span class="name">childFrames</span> () const</h3> <p>Returns a (possibly empty) list of the frame's child frames.</p> <p><b>See also </b><a href="qtextframe.html#parentFrame">parentFrame</a>().</p> <!-- @@@childFrames --> <!-- $$$end[overload1]$$$end --> <h3 class="fn"><a name="end"></a><span class="type"><a href="qtextframe-iterator.html">iterator</a></span> QTextFrame::<span class="name">end</span> () const</h3> <p>Returns an iterator pointing to the position past the last document element inside the frame. Please see the document <a href="containers.html#stl-style-iterators">STL-Style Iterators</a> for more information.</p> <p><b>See also </b><a href="qtextframe.html#begin">begin</a>().</p> <!-- @@@end --> <!-- $$$firstCursorPosition[overload1]$$$firstCursorPosition --> <h3 class="fn"><a name="firstCursorPosition"></a><span class="type"><a href="qtextcursor.html">QTextCursor</a></span> QTextFrame::<span class="name">firstCursorPosition</span> () const</h3> <p>Returns the first cursor position inside the frame.</p> <p><b>See also </b><a href="qtextframe.html#lastCursorPosition">lastCursorPosition</a>(), <a href="qtextframe.html#firstPosition">firstPosition</a>(), and <a href="qtextframe.html#lastPosition">lastPosition</a>().</p> <!-- @@@firstCursorPosition --> <!-- $$$firstPosition[overload1]$$$firstPosition --> <h3 class="fn"><a name="firstPosition"></a><span class="type">int</span> QTextFrame::<span class="name">firstPosition</span> () const</h3> <p>Returns the first document position inside the frame.</p> <p><b>See also </b><a href="qtextframe.html#lastPosition">lastPosition</a>(), <a href="qtextframe.html#firstCursorPosition">firstCursorPosition</a>(), and <a href="qtextframe.html#lastCursorPosition">lastCursorPosition</a>().</p> <!-- @@@firstPosition --> <!-- $$$frameFormat[overload1]$$$frameFormat --> <h3 class="fn"><a name="frameFormat"></a><span class="type"><a href="qtextframeformat.html">QTextFrameFormat</a></span> QTextFrame::<span class="name">frameFormat</span> () const</h3> <p>Returns the frame's format.</p> <p><b>See also </b><a href="qtextframe.html#setFrameFormat">setFrameFormat</a>().</p> <!-- @@@frameFormat --> <!-- $$$lastCursorPosition[overload1]$$$lastCursorPosition --> <h3 class="fn"><a name="lastCursorPosition"></a><span class="type"><a href="qtextcursor.html">QTextCursor</a></span> QTextFrame::<span class="name">lastCursorPosition</span> () const</h3> <p>Returns the last cursor position inside the frame.</p> <p><b>See also </b><a href="qtextframe.html#firstCursorPosition">firstCursorPosition</a>(), <a href="qtextframe.html#firstPosition">firstPosition</a>(), and <a href="qtextframe.html#lastPosition">lastPosition</a>().</p> <!-- @@@lastCursorPosition --> <!-- $$$lastPosition[overload1]$$$lastPosition --> <h3 class="fn"><a name="lastPosition"></a><span class="type">int</span> QTextFrame::<span class="name">lastPosition</span> () const</h3> <p>Returns the last document position inside the frame.</p> <p><b>See also </b><a href="qtextframe.html#firstPosition">firstPosition</a>(), <a href="qtextframe.html#firstCursorPosition">firstCursorPosition</a>(), and <a href="qtextframe.html#lastCursorPosition">lastCursorPosition</a>().</p> <!-- @@@lastPosition --> <!-- $$$parentFrame[overload1]$$$parentFrame --> <h3 class="fn"><a name="parentFrame"></a><span class="type">QTextFrame</span> * QTextFrame::<span class="name">parentFrame</span> () const</h3> <p>Returns the frame's parent frame. If the frame is the root frame of a document, this will return 0.</p> <p><b>See also </b><a href="qtextframe.html#childFrames">childFrames</a>() and <a href="qtextdocument.html#rootFrame">QTextDocument::rootFrame</a>().</p> <!-- @@@parentFrame --> <!-- $$$setFrameFormat[overload1]$$$setFrameFormatconstQTextFrameFormat& --> <h3 class="fn"><a name="setFrameFormat"></a><span class="type">void</span> QTextFrame::<span class="name">setFrameFormat</span> ( const <span class="type"><a href="qtextframeformat.html">QTextFrameFormat</a></span> & <i>format</i> )</h3> <p>Sets the frame's <i>format</i>.</p> <p><b>See also </b><a href="qtextframe.html#frameFormat">frameFormat</a>().</p> <!-- @@@setFrameFormat --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2013 Digia Plc 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> Digia, Qt and their respective logos are trademarks of Digia Plc 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> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>