<?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" /> <!-- qwebhistory.cpp --> <title>Qt 4.8: QWebHistory 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="qtwebkit.html">QtWebKit</a></li> <li>QWebHistory</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-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 Reference</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 --> <pre class="cpp"> <span class="preprocessor">#include <QWebHistory></span></pre><p>This class was introduced in Qt 4.4.</p> <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-67">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-44">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="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="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="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="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-67"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator<<</span> ( <span class="type"><a href="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-44"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator>></span> ( <span class="type"><a href="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 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>