<?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" /> <!-- q3intdict.qdoc --> <title>Qt 4.8: Q3IntDict 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>Qt3SupportLight</li> <li>Q3IntDict</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="#protected-functions">Protected Functions</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">Q3IntDict Class Reference</h1> <!-- $$$Q3IntDict-brief --> <p>The Q3IntDict class is a template class that provides a dictionary based on long keys. <a href="#details">More...</a></p> <!-- @@@Q3IntDict --> <pre class="cpp"> <span class="preprocessor">#include <Q3IntDict></span></pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html">Porting to Qt 4</a> for more information.</p> <p><b>Inherits: </b><a href="q3ptrcollection.html">Q3PtrCollection</a>.</p> <ul> <li><a href="q3intdict-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"> </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#Q3IntDict">Q3IntDict</a></b> ( int <i>size</i> = 17 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#Q3IntDict-2">Q3IntDict</a></b> ( const Q3IntDict<type> & <i>dict</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#dtor.Q3IntDict">~Q3IntDict</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#find">find</a></b> ( long <i>key</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#insert">insert</a></b> ( long <i>key</i>, const type * <i>item</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#isEmpty">isEmpty</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#remove">remove</a></b> ( long <i>key</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#replace">replace</a></b> ( long <i>key</i>, const type * <i>item</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#resize">resize</a></b> ( uint <i>newsize</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#size">size</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#statistics">statistics</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#take">take</a></b> ( long <i>key</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Q3IntDict<type> & </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#operator-eq">operator=</a></b> ( const Q3IntDict<type> & <i>dict</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#operator-5b-5d">operator[]</a></b> ( long <i>key</i> ) const</td></tr> </table> <a name="reimplemented-public-functions"></a> <h2>Reimplemented Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#clear">clear</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual uint </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#count">count</a></b> () const</td></tr> </table> <ul> <li class="fn">4 public functions inherited from <a href="q3ptrcollection.html#public-functions">Q3PtrCollection</a></li> </ul> <a name="protected-functions"></a> <h2>Protected Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#read">read</a></b> ( QDataStream & <i>s</i>, Q3PtrCollection::Item & <i>item</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="q3intdict.html#write">write</a></b> ( QDataStream & <i>s</i>, Q3PtrCollection::Item <i>item</i> ) const</td></tr> </table> <ul> <li class="fn">2 protected functions inherited from <a href="q3ptrcollection.html#protected-functions">Q3PtrCollection</a></li> </ul> <a name="details"></a> <!-- $$$Q3IntDict-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The Q3IntDict class is a template class that provides a dictionary based on long keys.</p> <p>Q3IntDict is implemented as a template class. Define a template instance Q3IntDict<X> to create a dictionary that operates on pointers to X (X*).</p> <p>A dictionary is a collection of key-value pairs. The key is an <tt>long</tt> used for insertion, removal and lookup. The value is a pointer. Dictionaries provide very fast insertion and lookup.</p> <p>Example:</p> <pre class="cpp"> <span class="type">Q3IntDict</span><span class="operator"><</span><span class="type"><a href="qlineedit.html">QLineEdit</a></span><span class="operator">></span> fields; <span class="comment">// long int keys, QLineEdit* values</span> <span class="keyword">for</span> ( <span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator"><</span> <span class="number">3</span>; i<span class="operator">+</span><span class="operator">+</span> ) fields<span class="operator">.</span><a href="q3intdict.html#insert">insert</a>( i<span class="operator">,</span> <span class="keyword">new</span> <span class="type"><a href="qlineedit.html">QLineEdit</a></span>( <span class="keyword">this</span> ) ); fields<span class="operator">[</span><span class="number">0</span><span class="operator">]</span><span class="operator">-</span><span class="operator">></span>setText( <span class="string">"Homer"</span> ); fields<span class="operator">[</span><span class="number">1</span><span class="operator">]</span><span class="operator">-</span><span class="operator">></span>setText( <span class="string">"Simpson"</span> ); fields<span class="operator">[</span><span class="number">2</span><span class="operator">]</span><span class="operator">-</span><span class="operator">></span>setText( <span class="string">"45"</span> ); <span class="type"><a href="q3intdictiterator.html">Q3IntDictIterator</a></span><span class="operator"><</span><span class="type"><a href="qlineedit.html">QLineEdit</a></span><span class="operator">></span> it( fields ); <span class="keyword">for</span> ( ; it<span class="operator">.</span>current(); <span class="operator">+</span><span class="operator">+</span>it ) cout <span class="operator"><</span><span class="operator"><</span> it<span class="operator">.</span>currentKey() <span class="operator"><</span><span class="operator"><</span> <span class="string">": "</span> <span class="operator"><</span><span class="operator"><</span> it<span class="operator">.</span>current()<span class="operator">-</span><span class="operator">></span>text() <span class="operator"><</span><span class="operator"><</span> endl; <span class="keyword">for</span> ( <span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator"><</span> <span class="number">3</span>; i<span class="operator">+</span><span class="operator">+</span> ) cout <span class="operator"><</span><span class="operator"><</span> fields<span class="operator">[</span>i<span class="operator">]</span><span class="operator">-</span><span class="operator">></span>text() <span class="operator"><</span><span class="operator"><</span> <span class="string">" "</span>; <span class="comment">// Prints "Homer Simpson 45"</span> cout <span class="operator"><</span><span class="operator"><</span> endl; fields<span class="operator">.</span><a href="q3intdict.html#remove">remove</a>( <span class="number">1</span> ); <span class="comment">// Does not delete the line edit</span> <span class="keyword">for</span> ( <span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator"><</span> <span class="number">3</span>; i<span class="operator">+</span><span class="operator">+</span> ) <span class="keyword">if</span> ( fields<span class="operator">[</span>i<span class="operator">]</span> ) cout <span class="operator"><</span><span class="operator"><</span> fields<span class="operator">[</span>i<span class="operator">]</span><span class="operator">-</span><span class="operator">></span>text() <span class="operator"><</span><span class="operator"><</span> <span class="string">" "</span>; <span class="comment">// Prints "Homer 45"</span></pre> <p>See <a href="q3dict.html">Q3Dict</a> for full details, including the choice of dictionary size, and how deletions are handled.</p> </div> <p><b>See also </b><a href="q3intdictiterator.html">Q3IntDictIterator</a>, <a href="q3dict.html">Q3Dict</a>, <a href="q3asciidict.html">Q3AsciiDict</a>, and <a href="q3ptrdict.html">Q3PtrDict</a>.</p> <!-- @@@Q3IntDict --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$Q3IntDict[overload1]$$$Q3IntDictint --> <h3 class="fn"><a name="Q3IntDict"></a>Q3IntDict::<span class="name">Q3IntDict</span> ( <span class="type">int</span> <i>size</i> = 17 )</h3> <p>Constructs a dictionary using an internal hash array of size <i>size</i>.</p> <p>Setting <i>size</i> to a suitably large prime number (equal to or greater than the expected number of entries) makes the hash distribution better which leads to faster lookup.</p> <!-- @@@Q3IntDict --> <!-- $$$Q3IntDict$$$Q3IntDictconstQ3IntDict<type>& --> <h3 class="fn"><a name="Q3IntDict-2"></a>Q3IntDict::<span class="name">Q3IntDict</span> ( const <span class="type">Q3IntDict</span><<span class="type">type</span>> & <i>dict</i> )</h3> <p>Constructs a copy of <i>dict</i>.</p> <p>Each item in <i>dict</i> is inserted into this dictionary. Only the pointers are copied (shallow copy).</p> <!-- @@@Q3IntDict --> <!-- $$$~Q3IntDict[overload1]$$$~Q3IntDict --> <h3 class="fn"><a name="dtor.Q3IntDict"></a>Q3IntDict::<span class="name">~Q3IntDict</span> ()</h3> <p>Removes all items from the dictionary and destroys it.</p> <p>All iterators that access this dictionary will be reset.</p> <p><b>See also </b><a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p> <!-- @@@~Q3IntDict --> <!-- $$$clear[overload1]$$$clear --> <h3 class="fn"><a name="clear"></a><span class="type">void</span> Q3IntDict::<span class="name">clear</span> ()<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="q3ptrcollection.html#clear">Q3PtrCollection::clear</a>().</p> <p>Removes all items from the dictionary.</p> <p>The removed items are deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p> <p>All dictionary iterators that access this dictionary will be reset.</p> <p><b>See also </b><a href="q3intdict.html#remove">remove</a>(), <a href="q3intdict.html#take">take</a>(), and <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p> <!-- @@@clear --> <!-- $$$count[overload1]$$$count --> <h3 class="fn"><a name="count"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> Q3IntDict::<span class="name">count</span> () const<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="q3ptrcollection.html#count">Q3PtrCollection::count</a>().</p> <p>Returns the number of items in the dictionary.</p> <p><b>See also </b><a href="q3intdict.html#isEmpty">isEmpty</a>().</p> <!-- @@@count --> <!-- $$$find[overload1]$$$findlong --> <h3 class="fn"><a name="find"></a><span class="type">type</span> * Q3IntDict::<span class="name">find</span> ( <span class="type">long</span> <i>key</i> ) const</h3> <p>Returns the item associated with <i>key</i>, or 0 if the key does not exist in the dictionary.</p> <p>If there are two or more items with equal keys, then the most recently inserted item will be found.</p> <p>Equivalent to operator[].</p> <p><b>See also </b><a href="q3intdict.html#operator-5b-5d">operator[]</a>().</p> <!-- @@@find --> <!-- $$$insert[overload1]$$$insertlongconsttype* --> <h3 class="fn"><a name="insert"></a><span class="type">void</span> Q3IntDict::<span class="name">insert</span> ( <span class="type">long</span> <i>key</i>, const <span class="type">type</span> * <i>item</i> )</h3> <p>Insert item <i>item</i> into the dictionary using key <i>key</i>.</p> <p>Multiple items can have the same key, in which case only the last item will be accessible using <a href="q3intdict.html#operator-5b-5d">operator[]</a>().</p> <p><i>item</i> may not be 0.</p> <p><b>See also </b><a href="q3intdict.html#replace">replace</a>().</p> <!-- @@@insert --> <!-- $$$isEmpty[overload1]$$$isEmpty --> <h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> Q3IntDict::<span class="name">isEmpty</span> () const</h3> <p>Returns TRUE if the dictionary is empty; otherwise returns FALSE.</p> <p><b>See also </b><a href="q3intdict.html#count">count</a>().</p> <!-- @@@isEmpty --> <!-- $$$read[overload1]$$$readQDataStream&Q3PtrCollection::Item& --> <h3 class="fn"><a name="read"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & Q3IntDict::<span class="name">read</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>s</i>, <span class="type"><a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a></span> & <i>item</i> )<tt> [virtual protected]</tt></h3> <p>Reads a dictionary item from the stream <i>s</i> and returns a reference to the stream.</p> <p>The default implementation sets <i>item</i> to 0.</p> <p><b>See also </b><a href="q3intdict.html#write">write</a>().</p> <!-- @@@read --> <!-- $$$remove[overload1]$$$removelong --> <h3 class="fn"><a name="remove"></a><span class="type">bool</span> Q3IntDict::<span class="name">remove</span> ( <span class="type">long</span> <i>key</i> )</h3> <p>Removes the item associated with <i>key</i> from the dictionary. Returns TRUE if successful, i.e. if the <i>key</i> is in the dictionary; otherwise returns FALSE.</p> <p>If there are two or more items with equal keys, then the most recently inserted item will be removed.</p> <p>The removed item is deleted if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled.</p> <p>All dictionary iterators that refer to the removed item will be set to point to the next item in the dictionary's traversal order.</p> <p><b>See also </b><a href="q3intdict.html#take">take</a>(), <a href="q3intdict.html#clear">clear</a>(), and <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p> <!-- @@@remove --> <!-- $$$replace[overload1]$$$replacelongconsttype* --> <h3 class="fn"><a name="replace"></a><span class="type">void</span> Q3IntDict::<span class="name">replace</span> ( <span class="type">long</span> <i>key</i>, const <span class="type">type</span> * <i>item</i> )</h3> <p>If the dictionary has key <i>key</i>, this key's item is replaced with <i>item</i>. If the dictionary doesn't contain key <i>key</i>, <i>item</i> is inserted into the dictionary using key <i>key</i>.</p> <p><i>item</i> may not be 0.</p> <p>Equivalent to:</p> <pre class="cpp"> <span class="type"><a href="q3intdict.html">Q3IntDict</a></span><span class="operator"><</span><span class="type">char</span><span class="operator">></span> dict; <span class="comment">// ...</span> <span class="keyword">if</span> ( dict<span class="operator">.</span>find(key) ) dict<span class="operator">.</span><a href="q3intdict.html#remove">remove</a>( key ); dict<span class="operator">.</span><a href="q3intdict.html#insert">insert</a>( key<span class="operator">,</span> item );</pre> <p>If there are two or more items with equal keys, then the most recently inserted item will be replaced.</p> <p><b>See also </b><a href="q3intdict.html#insert">insert</a>().</p> <!-- @@@replace --> <!-- $$$resize[overload1]$$$resizeuint --> <h3 class="fn"><a name="resize"></a><span class="type">void</span> Q3IntDict::<span class="name">resize</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>newsize</i> )</h3> <p>Changes the size of the hashtable to <i>newsize</i>. The contents of the dictionary are preserved, but all iterators on the dictionary become invalid.</p> <!-- @@@resize --> <!-- $$$size[overload1]$$$size --> <h3 class="fn"><a name="size"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> Q3IntDict::<span class="name">size</span> () const</h3> <p>Returns the size of the internal hash array (as specified in the constructor).</p> <p><b>See also </b><a href="q3intdict.html#count">count</a>().</p> <!-- @@@size --> <!-- $$$statistics[overload1]$$$statistics --> <h3 class="fn"><a name="statistics"></a><span class="type">void</span> Q3IntDict::<span class="name">statistics</span> () const</h3> <p>Debugging-only function that prints out the dictionary distribution using <a href="qtglobal.html#qDebug">qDebug</a>().</p> <!-- @@@statistics --> <!-- $$$take[overload1]$$$takelong --> <h3 class="fn"><a name="take"></a><span class="type">type</span> * Q3IntDict::<span class="name">take</span> ( <span class="type">long</span> <i>key</i> )</h3> <p>Takes the item associated with <i>key</i> out of the dictionary without deleting it (even if <a href="q3ptrcollection.html#setAutoDelete">auto-deletion</a> is enabled).</p> <p>If there are two or more items with equal keys, then the most recently inserted item will be taken.</p> <p>Returns a pointer to the item taken out, or 0 if the key does not exist in the dictionary.</p> <p>All dictionary iterators that refer to the taken item will be set to point to the next item in the dictionary's traversing order.</p> <p><b>See also </b><a href="q3intdict.html#remove">remove</a>(), <a href="q3intdict.html#clear">clear</a>(), and <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p> <!-- @@@take --> <!-- $$$write[overload1]$$$writeQDataStream&Q3PtrCollection::Item --> <h3 class="fn"><a name="write"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & Q3IntDict::<span class="name">write</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>s</i>, <span class="type"><a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a></span> <i>item</i> ) const<tt> [virtual protected]</tt></h3> <p>Writes a dictionary <i>item</i> to the stream <i>s</i> and returns a reference to the stream.</p> <p><b>See also </b><a href="q3intdict.html#read">read</a>().</p> <!-- @@@write --> <!-- $$$operator=[overload1]$$$operator=constQ3IntDict<type>& --> <h3 class="fn"><a name="operator-eq"></a><span class="type">Q3IntDict</span><<span class="type">type</span>> & Q3IntDict::<span class="name">operator=</span> ( const <span class="type">Q3IntDict</span><<span class="type">type</span>> & <i>dict</i> )</h3> <p>Assigns <i>dict</i> to this dictionary and returns a reference to this dictionary.</p> <p>This dictionary is first cleared and then each item in <i>dict</i> is inserted into this dictionary. Only the pointers are copied (shallow copy), unless <a href="q3ptrcollection.html#newItem">newItem</a>() has been reimplemented.</p> <!-- @@@operator= --> <!-- $$$operator[][overload1]$$$operator[]long --> <h3 class="fn"><a name="operator-5b-5d"></a><span class="type">type</span> * Q3IntDict::<span class="name">operator[]</span> ( <span class="type">long</span> <i>key</i> ) const</h3> <p>Returns the item associated with <i>key</i>, or 0 if the key does not exist in the dictionary.</p> <p>If there are two or more items with equal keys, then the most recently inserted item will be found.</p> <p>Equivalent to the <a href="q3intdict.html#find">find</a>() function.</p> <p><b>See also </b><a href="q3intdict.html#find">find</a>().</p> <!-- @@@operator[] --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd. 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> 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. <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>