Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 4632

qt-doc-4.8.5-10.fc18.noarch.rpm

<?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" />
<!-- q3ptrdict.qdoc -->
  <title>Qt 4.8: Q3PtrDict 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 &amp; 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>&nbsp;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 &amp; 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>Q3PtrDict</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">Q3PtrDict Class Reference</h1>
<!-- $$$Q3PtrDict-brief -->
<p>The Q3PtrDict class is a template class that provides a dictionary based on void* keys. <a href="#details">More...</a></p>
<!-- @@@Q3PtrDict -->
<pre class="cpp"> <span class="preprocessor">#include &lt;Q3PtrDict&gt;</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="q3ptrdict-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="q3ptrdict.html#Q3PtrDict">Q3PtrDict</a></b> ( int <i>size</i> = 17 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#Q3PtrDict-2">Q3PtrDict</a></b> ( const Q3PtrDict&lt;type&gt; &amp; <i>dict</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#dtor.Q3PtrDict">~Q3PtrDict</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#find">find</a></b> ( void * <i>key</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#insert">insert</a></b> ( void * <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="q3ptrdict.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#remove">remove</a></b> ( void * <i>key</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#replace">replace</a></b> ( void * <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="q3ptrdict.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="q3ptrdict.html#size">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#statistics">statistics</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#take">take</a></b> ( void * <i>key</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Q3PtrDict&lt;type&gt; &amp; </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#operator-eq">operator=</a></b> ( const Q3PtrDict&lt;type&gt; &amp; <i>dict</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> type * </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#operator-5b-5d">operator[]</a></b> ( void * <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="q3ptrdict.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual uint </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.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 &amp; </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#read">read</a></b> ( QDataStream &amp; <i>s</i>, Q3PtrCollection::Item &amp; <i>item</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="q3ptrdict.html#write">write</a></b> ( QDataStream &amp; <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>
<!-- $$$Q3PtrDict-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The Q3PtrDict class is a template class that provides a dictionary based on void* keys.</p>
<p>Q3PtrDict is implemented as a template class. Define a template instance Q3PtrDict&lt;X&gt; 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 a void* 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">Q3PtrDict</span><span class="operator">&lt;</span><span class="type">char</span><span class="operator">&gt;</span> fields; <span class="comment">// void* keys, char* values</span>

 <span class="type"><a href="qlineedit.html">QLineEdit</a></span> <span class="operator">*</span>le1 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlineedit.html">QLineEdit</a></span>( <span class="keyword">this</span> );
 le1<span class="operator">-</span><span class="operator">&gt;</span>setText( <span class="string">&quot;Simpson&quot;</span> );
 <span class="type"><a href="qlineedit.html">QLineEdit</a></span> <span class="operator">*</span>le2 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlineedit.html">QLineEdit</a></span>( <span class="keyword">this</span> );
 le2<span class="operator">-</span><span class="operator">&gt;</span>setText( <span class="string">&quot;Homer&quot;</span> );
 <span class="type"><a href="qlineedit.html">QLineEdit</a></span> <span class="operator">*</span>le3 <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlineedit.html">QLineEdit</a></span>( <span class="keyword">this</span> );
 le3<span class="operator">-</span><span class="operator">&gt;</span>setText( <span class="string">&quot;45&quot;</span> );

 fields<span class="operator">.</span><a href="q3ptrdict.html#insert">insert</a>( le1<span class="operator">,</span> <span class="string">&quot;Surname&quot;</span> );
 fields<span class="operator">.</span><a href="q3ptrdict.html#insert">insert</a>( le2<span class="operator">,</span> <span class="string">&quot;Forename&quot;</span> );
 fields<span class="operator">.</span><a href="q3ptrdict.html#insert">insert</a>( le3<span class="operator">,</span> <span class="string">&quot;Age&quot;</span> );

 <span class="type"><a href="q3ptrdictiterator.html">Q3PtrDictIterator</a></span><span class="operator">&lt;</span><span class="type">char</span><span class="operator">&gt;</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">&lt;</span><span class="operator">&lt;</span> it<span class="operator">.</span>current() <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;
 cout <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;

 <span class="keyword">if</span> ( fields<span class="operator">[</span>le1<span class="operator">]</span> ) <span class="comment">// Prints &quot;Surname: Simpson&quot;</span>
     cout <span class="operator">&lt;</span><span class="operator">&lt;</span> fields<span class="operator">[</span>le1<span class="operator">]</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;: &quot;</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> le1<span class="operator">-</span><span class="operator">&gt;</span>text() <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;
 <span class="keyword">if</span> ( fields<span class="operator">[</span>le2<span class="operator">]</span> ) <span class="comment">// Prints &quot;Forename: Homer&quot;</span>
     cout <span class="operator">&lt;</span><span class="operator">&lt;</span> fields<span class="operator">[</span>le2<span class="operator">]</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;: &quot;</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> le2<span class="operator">-</span><span class="operator">&gt;</span>text() <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;

 fields<span class="operator">.</span><a href="q3ptrdict.html#remove">remove</a>( le1 ); <span class="comment">// Removes le1 from the dictionary</span>
 cout <span class="operator">&lt;</span><span class="operator">&lt;</span> le1<span class="operator">-</span><span class="operator">&gt;</span>text() <span class="operator">&lt;</span><span class="operator">&lt;</span> endl; <span class="comment">// Prints &quot;Simpson&quot;</span></pre>
<p>In this example we use a dictionary to add an extra property (a char*) to the line edits we're using.</p>
<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="q3ptrdictiterator.html">Q3PtrDictIterator</a>, <a href="q3dict.html">Q3Dict</a>, <a href="q3asciidict.html">Q3AsciiDict</a>, and <a href="q3intdict.html">Q3IntDict</a>.</p>
<!-- @@@Q3PtrDict -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$Q3PtrDict[overload1]$$$Q3PtrDictint -->
<h3 class="fn"><a name="Q3PtrDict"></a>Q3PtrDict::<span class="name">Q3PtrDict</span> ( <span class="type">int</span> <i>size</i> = 17 )</h3>
<p>Constructs a dictionary using an internal hash array with the 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 and improves lookup performance.</p>
<!-- @@@Q3PtrDict -->
<!-- $$$Q3PtrDict$$$Q3PtrDictconstQ3PtrDict<type>& -->
<h3 class="fn"><a name="Q3PtrDict-2"></a>Q3PtrDict::<span class="name">Q3PtrDict</span> ( const <span class="type">Q3PtrDict</span>&lt;<span class="type">type</span>&gt; &amp; <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>
<!-- @@@Q3PtrDict -->
<!-- $$$~Q3PtrDict[overload1]$$$~Q3PtrDict -->
<h3 class="fn"><a name="dtor.Q3PtrDict"></a>Q3PtrDict::<span class="name">~Q3PtrDict</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>
<!-- @@@~Q3PtrDict -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> Q3PtrDict::<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="q3ptrdict.html#remove">remove</a>(), <a href="q3ptrdict.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> Q3PtrDict::<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="q3ptrdict.html#isEmpty">isEmpty</a>().</p>
<!-- @@@count -->
<!-- $$$find[overload1]$$$findvoid* -->
<h3 class="fn"><a name="find"></a><span class="type">type</span> * Q3PtrDict::<span class="name">find</span> ( <span class="type">void</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="q3ptrdict.html#operator-5b-5d">operator[]</a>().</p>
<!-- @@@find -->
<!-- $$$insert[overload1]$$$insertvoid*consttype* -->
<h3 class="fn"><a name="insert"></a><span class="type">void</span> Q3PtrDict::<span class="name">insert</span> ( <span class="type">void</span> * <i>key</i>, const <span class="type">type</span> * <i>item</i> )</h3>
<p>Inserts the <i>key</i> with the <i>item</i> into the dictionary.</p>
<p>Multiple items can have the same key, in which case only the last item will be accessible using <a href="q3ptrdict.html#operator-5b-5d">operator[]</a>().</p>
<p><i>item</i> may not be 0.</p>
<p><b>See also </b><a href="q3ptrdict.html#replace">replace</a>().</p>
<!-- @@@insert -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> Q3PtrDict::<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="q3ptrdict.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> &amp; Q3PtrDict::<span class="name">read</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>s</i>, <span class="type"><a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a></span> &amp; <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="q3ptrdict.html#write">write</a>().</p>
<!-- @@@read -->
<!-- $$$remove[overload1]$$$removevoid* -->
<h3 class="fn"><a name="remove"></a><span class="type">bool</span> Q3PtrDict::<span class="name">remove</span> ( <span class="type">void</span> * <i>key</i> )</h3>
<p>Removes the item associated with <i>key</i> from the dictionary. Returns TRUE if successful, i.e&#x2e; if <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 traversal order.</p>
<p><b>See also </b><a href="q3ptrdict.html#take">take</a>(), <a href="q3ptrdict.html#clear">clear</a>(), and <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>().</p>
<!-- @@@remove -->
<!-- $$$replace[overload1]$$$replacevoid*consttype* -->
<h3 class="fn"><a name="replace"></a><span class="type">void</span> Q3PtrDict::<span class="name">replace</span> ( <span class="type">void</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="q3ptrdict.html">Q3PtrDict</a></span><span class="operator">&lt;</span>ItemType<span class="operator">&gt;</span> dict;
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 <span class="keyword">if</span> ( dict<span class="operator">.</span>find( key ) )
     dict<span class="operator">.</span><a href="q3ptrdict.html#remove">remove</a>( key );
 dict<span class="operator">.</span><a href="q3ptrdict.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="q3ptrdict.html#insert">insert</a>().</p>
<!-- @@@replace -->
<!-- $$$resize[overload1]$$$resizeuint -->
<h3 class="fn"><a name="resize"></a><span class="type">void</span> Q3PtrDict::<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 hash table 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> Q3PtrDict::<span class="name">size</span> () const</h3>
<p>Returns the size of the internal hash table (as specified in the constructor).</p>
<p><b>See also </b><a href="q3ptrdict.html#count">count</a>().</p>
<!-- @@@size -->
<!-- $$$statistics[overload1]$$$statistics -->
<h3 class="fn"><a name="statistics"></a><span class="type">void</span> Q3PtrDict::<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]$$$takevoid* -->
<h3 class="fn"><a name="take"></a><span class="type">type</span> * Q3PtrDict::<span class="name">take</span> ( <span class="type">void</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 removed.</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 traversal order.</p>
<p><b>See also </b><a href="q3ptrdict.html#remove">remove</a>(), <a href="q3ptrdict.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> &amp; Q3PtrDict::<span class="name">write</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <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="q3ptrdict.html#read">read</a>().</p>
<!-- @@@write -->
<!-- $$$operator=[overload1]$$$operator=constQ3PtrDict<type>& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">Q3PtrDict</span>&lt;<span class="type">type</span>&gt; &amp; Q3PtrDict::<span class="name">operator=</span> ( const <span class="type">Q3PtrDict</span>&lt;<span class="type">type</span>&gt; &amp; <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 the dictionary. Only the pointers are copied (shallow copy), unless <a href="q3ptrcollection.html#newItem">newItem</a>() has been reimplemented.</p>
<!-- @@@operator= -->
<!-- $$$operator[][overload1]$$$operator[]void* -->
<h3 class="fn"><a name="operator-5b-5d"></a><span class="type">type</span> * Q3PtrDict::<span class="name">operator[]</span> ( <span class="type">void</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="q3ptrdict.html#find">find</a>() function.</p>
<p><b>See also </b><a href="q3ptrdict.html#find">find</a>().</p>
<!-- @@@operator[] -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</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>