<?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>iterator 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 >iterator</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="#public-functions">Public 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">iterator Class</h1> <span class="small-subtitle">(<a href="qtextframe-iterator.html">QTextFrame::iterator</a>)<br/></span> <!-- $$$iterator-brief --> <p>The iterator class provides an iterator for reading the contents of a <a href="qtextframe.html">QTextFrame</a>. <a href="#details">More...</a></p> <!-- @@@iterator --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <iterator></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr></table></div><ul> <li><a href="qtextframe-iterator-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h2 id="public-functions">Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#iterator">iterator</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#iterator-2">iterator</a></b>(const iterator &<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#iterator-3">iterator</a></b>(iterator &&<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#atEnd">atEnd</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QTextBlock </td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#currentBlock">currentBlock</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QTextFrame *</td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#currentFrame">currentFrame</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QTextFrame *</td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#parentFrame">parentFrame</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#operator-not-eq">operator!=</a></b>(const iterator &<i>other</i>) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> iterator &</td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#operator-2b-2b">operator++</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> iterator </td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#operator-2b-2b-1">operator++</a></b>(<i>int</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> iterator &</td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#operator--">operator--</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> iterator </td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#operator---1">operator--</a></b>(<i>int</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> iterator &</td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#operator-eq">operator=</a></b>(const iterator &<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> iterator &</td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#operator-eq-1">operator=</a></b>(iterator &&<i>other</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextframe-iterator.html#operator-eq-eq">operator==</a></b>(const iterator &<i>other</i>) const</td></tr> </table></div> <a name="details"></a> <!-- $$$iterator-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The iterator class provides an iterator for reading the contents of a <a href="qtextframe.html">QTextFrame</a>.</p> <p>A frame consists of an arbitrary sequence of <a href="qtextblock.html">QTextBlock</a>s and child <a href="qtextframe.html">QTextFrame</a>s. This class provides a way to iterate over the child objects of a frame, and read their contents. It does not provide a way to modify the contents of the frame.</p> </div> <!-- @@@iterator --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$iterator[overload1]$$$iterator --> <h3 class="fn" id="iterator"><a name="iterator"></a>iterator::<span class="name">iterator</span>()</h3> <p>Constructs an invalid iterator.</p> <!-- @@@iterator --> <!-- $$$iterator$$$iteratorconstiterator& --> <h3 class="fn" id="iterator-2"><a name="iterator-2"></a>iterator::<span class="name">iterator</span>(const <span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> &<i>other</i>)</h3> <p>Copy constructor. Constructs a copy of the <i>other</i> iterator.</p> <!-- @@@iterator --> <!-- $$$iterator$$$iteratoriterator&& --> <h3 class="fn" id="iterator-3"><a name="iterator-3"></a>iterator::<span class="name">iterator</span>(<span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> &&<i>other</i>)</h3> <p>Default constructs an instance of iterator.</p><!-- @@@iterator --> <!-- $$$atEnd[overload1]$$$atEnd --> <h3 class="fn" id="atEnd"><a name="atEnd"></a><span class="type">bool</span> iterator::<span class="name">atEnd</span>() const</h3> <p>Returns <code>true</code> if the current item is the last item in the text frame.</p> <!-- @@@atEnd --> <!-- $$$currentBlock[overload1]$$$currentBlock --> <h3 class="fn" id="currentBlock"><a name="currentBlock"></a><span class="type"><a href="qtextblock.html">QTextBlock</a></span> iterator::<span class="name">currentBlock</span>() const</h3> <p>Returns the current block the iterator points to. If the iterator points to a child frame, the returned block is invalid.</p> <p><b>See also </b><a href="qtextframe-iterator.html#currentFrame">currentFrame</a>().</p> <!-- @@@currentBlock --> <!-- $$$currentFrame[overload1]$$$currentFrame --> <h3 class="fn" id="currentFrame"><a name="currentFrame"></a><span class="type"><a href="qtextframe.html#QTextFrame">QTextFrame</a></span> *iterator::<span class="name">currentFrame</span>() const</h3> <p>Returns the current frame pointed to by the iterator, or 0 if the iterator currently points to a block.</p> <p><b>See also </b><a href="qtextframe-iterator.html#currentBlock">currentBlock</a>().</p> <!-- @@@currentFrame --> <!-- $$$parentFrame[overload1]$$$parentFrame --> <h3 class="fn" id="parentFrame"><a name="parentFrame"></a><span class="type"><a href="qtextframe.html#QTextFrame">QTextFrame</a></span> *iterator::<span class="name">parentFrame</span>() const</h3> <p>Returns the parent frame of the current frame.</p> <p><b>See also </b><a href="qtextframe-iterator.html#currentFrame">currentFrame</a>() and <a href="qtextframe.html#parentFrame">QTextFrame::parentFrame</a>().</p> <!-- @@@parentFrame --> <!-- $$$operator!=[overload1]$$$operator!=constiterator& --> <h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> iterator::<span class="name">operator!=</span>(const <span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> &<i>other</i>) const</h3> <p>Retuns true if the iterator is different from the <i>other</i> iterator; otherwise returns <code>false</code>.</p> <!-- @@@operator!= --> <!-- $$$operator++[overload1]$$$operator++ --> <h3 class="fn" id="operator-2b-2b"><a name="operator-2b-2b"></a><span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> &iterator::<span class="name">operator++</span>()</h3> <p>Moves the iterator to the next frame or block.</p> <p><b>See also </b><a href="qtextframe-iterator.html#currentBlock">currentBlock</a>() and <a href="qtextframe-iterator.html#currentFrame">currentFrame</a>().</p> <!-- @@@operator++ --> <!-- $$$operator++$$$operator++int --> <h3 class="fn" id="operator-2b-2b-1"><a name="operator-2b-2b-1"></a><span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> iterator::<span class="name">operator++</span>(<i>int</i>)</h3> <p>The postfix ++ operator (<code>i++</code>) advances the iterator to the next item in the text frame, and returns an iterator to the old item.</p> <!-- @@@operator++ --> <!-- $$$operator--[overload1]$$$operator-- --> <h3 class="fn" id="operator--"><a name="operator--"></a><span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> &iterator::<span class="name">operator--</span>()</h3> <p>Moves the iterator to the previous frame or block.</p> <p><b>See also </b><a href="qtextframe-iterator.html#currentBlock">currentBlock</a>() and <a href="qtextframe-iterator.html#currentFrame">currentFrame</a>().</p> <!-- @@@operator-- --> <!-- $$$operator--$$$operator--int --> <h3 class="fn" id="operator---1"><a name="operator---1"></a><span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> iterator::<span class="name">operator--</span>(<i>int</i>)</h3> <p>The postfix -- operator (<code>i--</code>) makes the preceding item in the current frame, and returns an iterator to the old item.</p> <!-- @@@operator-- --> <!-- $$$operator=[overload1]$$$operator=constiterator& --> <h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> &iterator::<span class="name">operator=</span>(const <span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> &<i>other</i>)</h3> <p>Assigns <i>other</i> to this iterator and returns a reference to this iterator.</p> <!-- @@@operator= --> <!-- $$$operator=$$$operator=iterator&& --> <h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> &iterator::<span class="name">operator=</span>(<span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> &&<i>other</i>)</h3> <p>Move-assignment operator.</p><!-- @@@operator= --> <!-- $$$operator==[overload1]$$$operator==constiterator& --> <h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> iterator::<span class="name">operator==</span>(const <span class="type"><a href="qtextframe-iterator.html#iterator">iterator</a></span> &<i>other</i>) const</h3> <p>Retuns true if the iterator is the same as the <i>other</i> iterator; otherwise returns <code>false</code>.</p> <!-- @@@operator== --> </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>