<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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" /> <!-- qwebhistory.cpp --> <title>QWebHistory Class | QtWebKit 5.2</title> <link rel="stylesheet" type="text/css" href="style/offline.css" /> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <ul> <li><a href="../qtdoc/index.html">Qt 5.2</a></li> <li>QWebHistory</li> <li id="buildversion"> Qt 5.2.1 Reference Documentation</li> </ul> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <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="#related-non-members">Related Non-Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QWebHistory Class</h1> <!-- $$$QWebHistory-brief --> <p>The QWebHistory class represents the history of a <a href="qwebpage.html">QWebPage</a> <a href="#details">More...</a></p> <!-- @@@QWebHistory --> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> </b><tt><span class="preprocessor">#include <QWebHistory></span> </tt></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 4.4</td></tr></table><ul> <li><a href="qwebhistory-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#back">back</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QWebHistoryItem </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#backItem">backItem</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QList<QWebHistoryItem> </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#backItems">backItems</a></b>(int<i> maxItems</i>) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#canGoBack">canGoBack</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#canGoForward">canGoForward</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#clear">clear</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#count">count</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QWebHistoryItem </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#currentItem">currentItem</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#currentItemIndex">currentItemIndex</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#forward">forward</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QWebHistoryItem </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#forwardItem">forwardItem</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QList<QWebHistoryItem> </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#forwardItems">forwardItems</a></b>(int<i> maxItems</i>) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#goToItem">goToItem</a></b>(const QWebHistoryItem &<i> item</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QWebHistoryItem </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#itemAt">itemAt</a></b>(int<i> i</i>) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QList<QWebHistoryItem> </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#items">items</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#maximumItemCount">maximumItemCount</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#setMaximumItemCount">setMaximumItemCount</a></b>(int<i> count</i>)</td></tr> </table> <a name="related-non-members"></a> <h2>Related Non-Members</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#operator-lt-lt-165">operator<<</a></b>(QDataStream &<i> stream</i>, const QWebHistory &<i> history</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="qwebhistory.html#operator-gt-gt-75">operator>></a></b>(QDataStream &<i> stream</i>, QWebHistory &<i> history</i>)</td></tr> </table> <a name="details"></a> <!-- $$$QWebHistory-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QWebHistory class represents the history of a <a href="qwebpage.html">QWebPage</a></p> <p>Each <a href="qwebpage.html">QWebPage</a> instance contains a history of visited pages that can be accessed by <a href="qwebpage.html#history">QWebPage::history</a>(). QWebHistory represents this history and makes it possible to navigate it.</p> <p>The history uses the concept of a <i>current item</i>, dividing the pages visited into those that can be visited by navigating <i>back</i> and <i>forward</i> using the <a href="qwebhistory.html#back">back</a>() and <a href="qwebhistory.html#forward">forward</a>() functions. The current item can be obtained by calling <a href="qwebhistory.html#currentItem">currentItem</a>(), and an arbitrary item in the history can be made the current item by passing it to <a href="qwebhistory.html#goToItem">goToItem</a>().</p> <p>A list of items describing the pages that can be visited by going back can be obtained by calling the <a href="qwebhistory.html#backItems">backItems</a>() function; similarly, items describing the pages ahead of the current page can be obtained with the <a href="qwebhistory.html#forwardItems">forwardItems</a>() function. The total list of items is obtained with the <a href="qwebhistory.html#items">items</a>() function.</p> <p>Just as with containers, functions are available to examine the history in terms of a list. Arbitrary items in the history can be obtained with <a href="qwebhistory.html#itemAt">itemAt</a>(), the total number of items is given by <a href="qwebhistory.html#count">count</a>(), and the history can be cleared with the <a href="qwebhistory.html#clear">clear</a>() function.</p> <p>QWebHistory's state can be saved to a <a href="../qtcore/qdatastream.html">QDataStream</a> using the >> operator and loaded by using the << operator.</p> </div> <p><b>See also </b><a href="qwebhistoryitem.html">QWebHistoryItem</a>, <a href="qwebhistoryinterface.html">QWebHistoryInterface</a>, and <a href="qwebpage.html">QWebPage</a>.</p> <!-- @@@QWebHistory --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$back[overload1]$$$back --> <h3 class="fn"><a name="back"></a><span class="type">void</span> QWebHistory::<span class="name">back</span>()</h3> <p>Set the current item to be the previous item in the history and goes to the corresponding page; i.e., goes back one history item.</p> <p><b>See also </b><a href="qwebhistory.html#forward">forward</a>() and <a href="qwebhistory.html#goToItem">goToItem</a>().</p> <!-- @@@back --> <!-- $$$backItem[overload1]$$$backItem --> <h3 class="fn"><a name="backItem"></a><span class="type"><a href="qwebhistoryitem.html">QWebHistoryItem</a></span> QWebHistory::<span class="name">backItem</span>() const</h3> <p>Returns the item before the current item in the history.</p> <!-- @@@backItem --> <!-- $$$backItems[overload1]$$$backItemsint --> <h3 class="fn"><a name="backItems"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span><<span class="type"><a href="qwebhistoryitem.html">QWebHistoryItem</a></span>> QWebHistory::<span class="name">backItems</span>(<span class="type">int</span><i> maxItems</i>) const</h3> <p>Returns the list of items in the backwards history list. At most <i>maxItems</i> entries are returned.</p> <p><b>See also </b><a href="qwebhistory.html#forwardItems">forwardItems</a>().</p> <!-- @@@backItems --> <!-- $$$canGoBack[overload1]$$$canGoBack --> <h3 class="fn"><a name="canGoBack"></a><span class="type">bool</span> QWebHistory::<span class="name">canGoBack</span>() const</h3> <p>Returns true if there is an item preceding the current item in the history; otherwise returns false.</p> <p><b>See also </b><a href="qwebhistory.html#canGoForward">canGoForward</a>().</p> <!-- @@@canGoBack --> <!-- $$$canGoForward[overload1]$$$canGoForward --> <h3 class="fn"><a name="canGoForward"></a><span class="type">bool</span> QWebHistory::<span class="name">canGoForward</span>() const</h3> <p>Returns true if we have an item to go forward to; otherwise returns false.</p> <p><b>See also </b><a href="qwebhistory.html#canGoBack">canGoBack</a>().</p> <!-- @@@canGoForward --> <!-- $$$clear[overload1]$$$clear --> <h3 class="fn"><a name="clear"></a><span class="type">void</span> QWebHistory::<span class="name">clear</span>()</h3> <p>Clears the history.</p> <p><b>See also </b><a href="qwebhistory.html#count">count</a>() and <a href="qwebhistory.html#items">items</a>().</p> <!-- @@@clear --> <!-- $$$count[overload1]$$$count --> <h3 class="fn"><a name="count"></a><span class="type">int</span> QWebHistory::<span class="name">count</span>() const</h3> <p>Returns the total number of items in the history.</p> <!-- @@@count --> <!-- $$$currentItem[overload1]$$$currentItem --> <h3 class="fn"><a name="currentItem"></a><span class="type"><a href="qwebhistoryitem.html">QWebHistoryItem</a></span> QWebHistory::<span class="name">currentItem</span>() const</h3> <p>Returns the current item in the history.</p> <!-- @@@currentItem --> <!-- $$$currentItemIndex[overload1]$$$currentItemIndex --> <h3 class="fn"><a name="currentItemIndex"></a><span class="type">int</span> QWebHistory::<span class="name">currentItemIndex</span>() const</h3> <p>Returns the index of the current item in history.</p> <p>This function was introduced in Qt 4.5.</p> <!-- @@@currentItemIndex --> <!-- $$$forward[overload1]$$$forward --> <h3 class="fn"><a name="forward"></a><span class="type">void</span> QWebHistory::<span class="name">forward</span>()</h3> <p>Sets the current item to be the next item in the history and goes to the corresponding page; i.e., goes forward one history item.</p> <p><b>See also </b><a href="qwebhistory.html#back">back</a>() and <a href="qwebhistory.html#goToItem">goToItem</a>().</p> <!-- @@@forward --> <!-- $$$forwardItem[overload1]$$$forwardItem --> <h3 class="fn"><a name="forwardItem"></a><span class="type"><a href="qwebhistoryitem.html">QWebHistoryItem</a></span> QWebHistory::<span class="name">forwardItem</span>() const</h3> <p>Returns the item after the current item in the history.</p> <!-- @@@forwardItem --> <!-- $$$forwardItems[overload1]$$$forwardItemsint --> <h3 class="fn"><a name="forwardItems"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span><<span class="type"><a href="qwebhistoryitem.html">QWebHistoryItem</a></span>> QWebHistory::<span class="name">forwardItems</span>(<span class="type">int</span><i> maxItems</i>) const</h3> <p>Returns the list of items in the forward history list. At most <i>maxItems</i> entries are returned.</p> <p><b>See also </b><a href="qwebhistory.html#backItems">backItems</a>().</p> <!-- @@@forwardItems --> <!-- $$$goToItem[overload1]$$$goToItemconstQWebHistoryItem& --> <h3 class="fn"><a name="goToItem"></a><span class="type">void</span> QWebHistory::<span class="name">goToItem</span>(const <span class="type"><a href="qwebhistoryitem.html">QWebHistoryItem</a></span> &<i> item</i>)</h3> <p>Sets the current item to be the specified <i>item</i> in the history and goes to the page.</p> <p><b>See also </b><a href="qwebhistory.html#back">back</a>() and <a href="qwebhistory.html#forward">forward</a>().</p> <!-- @@@goToItem --> <!-- $$$itemAt[overload1]$$$itemAtint --> <h3 class="fn"><a name="itemAt"></a><span class="type"><a href="qwebhistoryitem.html">QWebHistoryItem</a></span> QWebHistory::<span class="name">itemAt</span>(<span class="type">int</span><i> i</i>) const</h3> <p>Returns the item at index <i>i</i> in the history.</p> <!-- @@@itemAt --> <!-- $$$items[overload1]$$$items --> <h3 class="fn"><a name="items"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span><<span class="type"><a href="qwebhistoryitem.html">QWebHistoryItem</a></span>> QWebHistory::<span class="name">items</span>() const</h3> <p>Returns a list of all items currently in the history.</p> <p><b>See also </b><a href="qwebhistory.html#count">count</a>() and <a href="qwebhistory.html#clear">clear</a>().</p> <!-- @@@items --> <!-- $$$maximumItemCount[overload1]$$$maximumItemCount --> <h3 class="fn"><a name="maximumItemCount"></a><span class="type">int</span> QWebHistory::<span class="name">maximumItemCount</span>() const</h3> <p>Returns the maximum number of items in the history.</p> <p>This function was introduced in Qt 4.5.</p> <p><b>See also </b><a href="qwebhistory.html#setMaximumItemCount">setMaximumItemCount</a>().</p> <!-- @@@maximumItemCount --> <!-- $$$setMaximumItemCount[overload1]$$$setMaximumItemCountint --> <h3 class="fn"><a name="setMaximumItemCount"></a><span class="type">void</span> QWebHistory::<span class="name">setMaximumItemCount</span>(<span class="type">int</span><i> count</i>)</h3> <p>Sets the maximum number of items in the history to <i>count</i>.</p> <p>This function was introduced in Qt 4.5.</p> <p><b>See also </b><a href="qwebhistory.html#maximumItemCount">maximumItemCount</a>().</p> <!-- @@@setMaximumItemCount --> </div> <div class="relnonmem"> <h2>Related Non-Members</h2> <!-- $$$operator<<$$$operator<<QDataStream&constQWebHistory& --> <h3 class="fn"><a name="operator-lt-lt-165"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> & <span class="name">operator<<</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &<i> stream</i>, const <span class="type">QWebHistory</span> &<i> history</i>)</h3> <p>The operator<< function streams a history into a data stream.</p> <p>It saves the <i>history</i> into the specified <i>stream</i>.</p> <p>This function was introduced in Qt 4.6.</p> <!-- @@@operator<< --> <!-- $$$operator>>$$$operator>>QDataStream&QWebHistory& --> <h3 class="fn"><a name="operator-gt-gt-75"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> & <span class="name">operator>></span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &<i> stream</i>, <span class="type">QWebHistory</span> &<i> history</i>)</h3> <p>The operator>> function loads a history from a data stream.</p> <p>Loads a <a href="qwebhistory.html">QWebHistory</a> from the specified <i>stream</i> into the given <i>history</i>.</p> <p>This function was introduced in Qt 4.6.</p> <!-- @@@operator>> --> </div> </div> </div> </div> </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.<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> 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. </p> </div> </body> </html>