<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qtextobject.cpp --> <title>QTextBlockGroup Class | Qt GUI 5.12.6</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.12</td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QTextBlockGroup</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.12.6 Reference Documentation</a></td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#static-public-members">Static Public Members</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> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">QTextBlockGroup Class</h1> <!-- $$$QTextBlockGroup-brief --> <p>The <a href="qtextblockgroup.html">QTextBlockGroup</a> class provides a container for text blocks within a <a href="qtextdocument.html">QTextDocument</a>. <a href="#details">More...</a></p> <!-- @@@QTextBlockGroup --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QTextBlockGroup></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qtextobject.html">QTextObject</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qtextlist.html">QTextList</a></p> </td></tr></table></div><ul> <li><a href="qtextblockgroup-members.html">List of all members, including inherited members</a></li> <li><a href="qtextblockgroup-obsolete.html">Obsolete members</a></li> </ul> <p><b>Note:</b> All functions in this class are reentrant.</p> <a name="static-public-members"></a> <h2 id="static-public-members">Static Public Members</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qtextblockgroup.html#staticMetaObject-var">staticMetaObject</a></b></td></tr> </table></div> <ul> <li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li> </ul> <a name="protected-functions"></a> <h2 id="protected-functions">Protected Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextblockgroup.html#QTextBlockGroup">QTextBlockGroup</a></b>(QTextDocument *<i>document</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qtextblockgroup.html#dtor.QTextBlockGroup">~QTextBlockGroup</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockgroup.html#blockFormatChanged">blockFormatChanged</a></b>(const QTextBlock &<i>block</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockgroup.html#blockInserted">blockInserted</a></b>(const QTextBlock &<i>block</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QList<QTextBlock> </td><td class="memItemRight bottomAlign"><b><a href="qtextblockgroup.html#blockList">blockList</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextblockgroup.html#blockRemoved">blockRemoved</a></b>(const QTextBlock &<i>block</i>)</td></tr> </table></div> <ul> <li class="fn">1 protected function inherited from <a href="qtextobject.html#protected-functions">QTextObject</a></li> <li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li> <li class="fn">4 public functions inherited from <a href="qtextobject.html#public-functions">QTextObject</a></li> <li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li> <li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li> <li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li> </ul> <a name="details"></a> <!-- $$$QTextBlockGroup-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qtextblockgroup.html">QTextBlockGroup</a> class provides a container for text blocks within a <a href="qtextdocument.html">QTextDocument</a>.</p> <p>Block groups can be used to organize blocks of text within a document. They maintain an up-to-date list of the text blocks that belong to them, even when text blocks are being edited.</p> <p>Each group has a parent document which is specified when the group is constructed.</p> <p>Text blocks can be inserted into a group with <a href="qtextblockgroup.html#blockInserted">blockInserted</a>(), and removed with <a href="qtextblockgroup.html#blockRemoved">blockRemoved</a>(). If a block's format is changed, <a href="qtextblockgroup.html#blockFormatChanged">blockFormatChanged</a>() is called.</p> <p>The list of blocks in the group is returned by <a href="qtextblockgroup.html#blockList">blockList</a>(). Note that the blocks in the list are not necessarily adjacent elements in the document; for example, the top-level items in a multi-level list will be separated by the items in lower levels of the list.</p> </div> <p><b>See also </b><a href="qtextblock.html">QTextBlock</a> and <a href="qtextdocument.html">QTextDocument</a>.</p> <!-- @@@QTextBlockGroup --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QTextBlockGroup[overload1]$$$QTextBlockGroupQTextDocument* --> <h3 class="fn" id="QTextBlockGroup"><a name="QTextBlockGroup"></a><code>[protected] </code>QTextBlockGroup::<span class="name">QTextBlockGroup</span>(<span class="type"><a href="qtextdocument.html">QTextDocument</a></span> *<i>document</i>)</h3> <p>Creates a new new block group for the given <i>document</i>.</p> <p><b>Warning:</b> This function should only be called from <a href="qtextdocument.html#createObject">QTextDocument::createObject</a>().</p> <!-- @@@QTextBlockGroup --> <!-- $$$~QTextBlockGroup[overload1]$$$~QTextBlockGroup --> <h3 class="fn" id="dtor.QTextBlockGroup"><a name="dtor.QTextBlockGroup"></a><code>[virtual protected] </code>QTextBlockGroup::<span class="name">~QTextBlockGroup</span>()</h3> <p>Destroys this block group; the blocks are not deleted, they simply don't belong to this block anymore.</p> <!-- @@@~QTextBlockGroup --> <!-- $$$blockFormatChanged[overload1]$$$blockFormatChangedconstQTextBlock& --> <h3 class="fn" id="blockFormatChanged"><a name="blockFormatChanged"></a><code>[virtual protected] </code><span class="type">void</span> QTextBlockGroup::<span class="name">blockFormatChanged</span>(const <span class="type"><a href="qtextblock.html">QTextBlock</a></span> &<i>block</i>)</h3> <p>This function is called whenever the specified <i>block</i> of text is changed. The text block is a member of this group.</p> <p>The base class implementation does nothing.</p> <!-- @@@blockFormatChanged --> <!-- $$$blockInserted[overload1]$$$blockInsertedconstQTextBlock& --> <h3 class="fn" id="blockInserted"><a name="blockInserted"></a><code>[virtual protected] </code><span class="type">void</span> QTextBlockGroup::<span class="name">blockInserted</span>(const <span class="type"><a href="qtextblock.html">QTextBlock</a></span> &<i>block</i>)</h3> <p>Appends the given <i>block</i> to the end of the group.</p> <p><b>Warning:</b> If you reimplement this function you must call the base class implementation.</p> <!-- @@@blockInserted --> <!-- $$$blockList[overload1]$$$blockList --> <h3 class="fn" id="blockList"><a name="blockList"></a><code>[protected] </code><span class="type">QList</span><<span class="type"><a href="qtextblock.html">QTextBlock</a></span>> QTextBlockGroup::<span class="name">blockList</span>() const</h3> <p>Returns a (possibly empty) list of all the blocks that are part of the block group.</p> <!-- @@@blockList --> <!-- $$$blockRemoved[overload1]$$$blockRemovedconstQTextBlock& --> <h3 class="fn" id="blockRemoved"><a name="blockRemoved"></a><code>[virtual protected] </code><span class="type">void</span> QTextBlockGroup::<span class="name">blockRemoved</span>(const <span class="type"><a href="qtextblock.html">QTextBlock</a></span> &<i>block</i>)</h3> <p>Removes the given <i>block</i> from the group; the block itself is not deleted, it simply isn't a member of this group anymore.</p> <!-- @@@blockRemoved --> </div> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br/> 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.<br/> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>