Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 4f45e7bdfd4a5ff17f5f8eaab90d017f > files > 729

albumshaper-2.1-6mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AlbumShaper: RecentAlbumMenuItem Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>RecentAlbumMenuItem Class Reference</h1><!-- doxytag: class="RecentAlbumMenuItem" --><!-- doxytag: inherits="QCustomMenuItem" -->A custom menu entry, displays album image, name, and number of photos.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="recentAlbumMenuItem_8h_source.html">recentAlbumMenuItem.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for RecentAlbumMenuItem:</div>
<div class="dynsection">
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
<div class="dynheader">
Collaboration diagram for RecentAlbumMenuItem:</div>
<div class="dynsection">
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classRecentAlbumMenuItem-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#354ab25f0544318701dcfef55e905ebb">RecentAlbumMenuItem</a> (Key <a class="el" href="classRecentAlbumMenuItem.html#36498fbf466c609c7d1d7900c093682b">acceleratorKey</a>)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#8f24dece7400a13da2e48ab8a70b29d2">changeItem</a> (QString <a class="el" href="classRecentAlbumMenuItem.html#99a2324b66081f9fda0716880905c157">albumName</a>, QString albumLocation, QString <a class="el" href="classRecentAlbumMenuItem.html#569129eb48599392a7b8e090ad4217c9">numPhotos</a>)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">updates entry as per arguments passed (used by constructor during intiailization as well)  <a href="#8f24dece7400a13da2e48ab8a70b29d2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#dbae14ce02aab6186cc91ce1a02600fc">paint</a> (QPainter *p, const QColorGroup &amp;cg, bool act, bool enabled, int x, int y, int w, int h)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">paints entry  <a href="#dbae14ce02aab6186cc91ce1a02600fc"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QSize&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#42a7d14255eb18be7b52009921c4d6ad">sizeHint</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns menu entry size  <a href="#42a7d14255eb18be7b52009921c4d6ad"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#8fbcd4bb687b9a6ca0e1171fe0848a1f">setMaxWidth</a> (int val)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">after all menu items have been refreshed hint at maximum width so we can adequately position the accelerator text  <a href="#8fbcd4bb687b9a6ca0e1171fe0848a1f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#43fb3d3e87cfcd20190f051228134ebb">fullSpan</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">no icon necessary since album image painted here  <a href="#43fb3d3e87cfcd20190f051228134ebb"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">Key&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#36498fbf466c609c7d1d7900c093682b">acceleratorKey</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">QImage&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#947ab36fc08c87e0997e9237ee237554">albumImage</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">album image  <a href="#947ab36fc08c87e0997e9237ee237554"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QString&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#99a2324b66081f9fda0716880905c157">albumName</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">album name  <a href="#99a2324b66081f9fda0716880905c157"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QString&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#569129eb48599392a7b8e090ad4217c9">numPhotos</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">number of photos  <a href="#569129eb48599392a7b8e090ad4217c9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QSize&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#fa0cbaf725a37f20af94b10b02a8a73c">size</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">computed size  <a href="#fa0cbaf725a37f20af94b10b02a8a73c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#24a7b428c635dce4efe51dd27dad6cd3">maxWidth</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">max element width  <a href="#24a7b428c635dce4efe51dd27dad6cd3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRecentAlbumMenuItem.html#37540412a8fd5ee7add7ebfea246e0f7">idealImageWidth</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">used for painting purposes  <a href="#37540412a8fd5ee7add7ebfea246e0f7"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A custom menu entry, displays album image, name, and number of photos. 
<p>Definition at line <a class="el" href="recentAlbumMenuItem_8h_source.html#l00023">23</a> of file <a class="el" href="recentAlbumMenuItem_8h_source.html">recentAlbumMenuItem.h</a>.</p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="354ab25f0544318701dcfef55e905ebb"></a><!-- doxytag: member="RecentAlbumMenuItem::RecentAlbumMenuItem" ref="354ab25f0544318701dcfef55e905ebb" args="(Key acceleratorKey)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">RecentAlbumMenuItem::RecentAlbumMenuItem           </td>
          <td>(</td>
          <td class="paramtype">Key&nbsp;</td>
          <td class="paramname"> <em>acceleratorKey</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00022">22</a> of file <a class="el" href="recentAlbumMenuItem_8cpp_source.html">recentAlbumMenuItem.cpp</a>.</p>

<p>References <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00028">changeItem()</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00022"></a>00022                                                              : <a class="code" href="classQCustomMenuItem.html">QCustomMenuItem</a>()
<a name="l00023"></a>00023 {
<a name="l00024"></a>00024   this-&gt;<a class="code" href="classRecentAlbumMenuItem.html#36498fbf466c609c7d1d7900c093682b">acceleratorKey</a> = <a class="code" href="classRecentAlbumMenuItem.html#36498fbf466c609c7d1d7900c093682b">acceleratorKey</a>;
<a name="l00025"></a>00025   <a class="code" href="classRecentAlbumMenuItem.html#8f24dece7400a13da2e48ab8a70b29d2" title="updates entry as per arguments passed (used by constructor during intiailization...">changeItem</a>( <span class="stringliteral">"unitialized"</span>, <span class="stringliteral">"unitialized"</span>, <span class="stringliteral">"unitialized"</span> );
<a name="l00026"></a>00026 }
</pre></div>
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="8f24dece7400a13da2e48ab8a70b29d2"></a><!-- doxytag: member="RecentAlbumMenuItem::changeItem" ref="8f24dece7400a13da2e48ab8a70b29d2" args="(QString albumName, QString albumLocation, QString numPhotos)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RecentAlbumMenuItem::changeItem           </td>
          <td>(</td>
          <td class="paramtype">QString&nbsp;</td>
          <td class="paramname"> <em>albumName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QString&nbsp;</td>
          <td class="paramname"> <em>albumLocation</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QString&nbsp;</td>
          <td class="paramname"> <em>numPhotos</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
updates entry as per arguments passed (used by constructor during intiailization as well) 
<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00028">28</a> of file <a class="el" href="recentAlbumMenuItem_8cpp_source.html">recentAlbumMenuItem.cpp</a>.</p>

<p>References <a class="el" href="recentAlbumMenuItem_8h_source.html#l00051">albumImage</a>, <a class="el" href="recentAlbumMenuItem_8h_source.html#l00066">idealImageWidth</a>, <a class="el" href="imageTools_8cpp_source.html#l00157">scaleImage()</a>, and <a class="el" href="recentAlbumMenuItem_8h_source.html#l00060">size</a>.</p>

<p>Referenced by <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00022">RecentAlbumMenuItem()</a>, and <a class="el" href="titleWidget_8cpp_source.html#l01435">TitleWidget::refreshOpenRecentMenu()</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00031"></a>00031 {
<a name="l00032"></a>00032   <span class="comment">//set name, and number of photos</span>
<a name="l00033"></a>00033   this-&gt;<a class="code" href="classRecentAlbumMenuItem.html#99a2324b66081f9fda0716880905c157" title="album name">albumName</a> = <a class="code" href="classRecentAlbumMenuItem.html#99a2324b66081f9fda0716880905c157" title="album name">albumName</a>;
<a name="l00034"></a>00034   this-&gt;<a class="code" href="classRecentAlbumMenuItem.html#569129eb48599392a7b8e090ad4217c9" title="number of photos">numPhotos</a> = <a class="code" href="classRecentAlbumMenuItem.html#569129eb48599392a7b8e090ad4217c9" title="number of photos">numPhotos</a>;
<a name="l00035"></a>00035   
<a name="l00036"></a>00036   <span class="comment">//compute height</span>
<a name="l00037"></a>00037   QFontMetrics fm( qApp-&gt;font() );
<a name="l00038"></a>00038   <a class="code" href="classRecentAlbumMenuItem.html#fa0cbaf725a37f20af94b10b02a8a73c" title="computed size">size</a>.setHeight( 2 + fm.leading() + 2*fm.height() + 2);
<a name="l00039"></a>00039   
<a name="l00040"></a>00040   <span class="comment">//attempt to set album image   </span>
<a name="l00041"></a>00041   QString albumImageLocation = QDir::convertSeparators( albumLocation + <span class="stringliteral">"/img/album.jpg"</span> );
<a name="l00042"></a>00042   QDir tempDir;
<a name="l00043"></a>00043   <span class="keywordflow">if</span>( tempDir.exists( albumImageLocation ) )
<a name="l00044"></a>00044   {       
<a name="l00045"></a>00045     <span class="comment">//ideal image width assuming 4:3 aspect ratio</span>
<a name="l00046"></a>00046     <a class="code" href="classRecentAlbumMenuItem.html#37540412a8fd5ee7add7ebfea246e0f7" title="used for painting purposes">idealImageWidth</a> = (4 * (<a class="code" href="classRecentAlbumMenuItem.html#fa0cbaf725a37f20af94b10b02a8a73c" title="computed size">size</a>.height()-4) ) / 3;
<a name="l00047"></a>00047     
<a name="l00048"></a>00048     <span class="comment">//scale image</span>
<a name="l00049"></a>00049     <a class="code" href="imageTools_8cpp.html#126e11984fb8124e78e3b1b68a24870c" title="Scale image and save copy to disk.">scaleImage</a>( albumImageLocation, <a class="code" href="classRecentAlbumMenuItem.html#947ab36fc08c87e0997e9237ee237554" title="album image">albumImage</a>, <a class="code" href="classRecentAlbumMenuItem.html#37540412a8fd5ee7add7ebfea246e0f7" title="used for painting purposes">idealImageWidth</a>, <a class="code" href="classRecentAlbumMenuItem.html#fa0cbaf725a37f20af94b10b02a8a73c" title="computed size">size</a>.height() );
<a name="l00050"></a>00050   }
<a name="l00051"></a>00051   <span class="keywordflow">else</span>
<a name="l00052"></a>00052   {
<a name="l00053"></a>00053     <a class="code" href="classRecentAlbumMenuItem.html#37540412a8fd5ee7add7ebfea246e0f7" title="used for painting purposes">idealImageWidth</a> = 0;
<a name="l00054"></a>00054   }
<a name="l00055"></a>00055   
<a name="l00056"></a>00056   <span class="comment">//compute menu entry width</span>
<a name="l00057"></a>00057   <a class="code" href="classRecentAlbumMenuItem.html#fa0cbaf725a37f20af94b10b02a8a73c" title="computed size">size</a>.setWidth( <a class="code" href="classRecentAlbumMenuItem.html#37540412a8fd5ee7add7ebfea246e0f7" title="used for painting purposes">idealImageWidth</a> + 2 + fm.width(<a class="code" href="classRecentAlbumMenuItem.html#99a2324b66081f9fda0716880905c157" title="album name">albumName</a>) );
<a name="l00058"></a>00058 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="43fb3d3e87cfcd20190f051228134ebb"></a><!-- doxytag: member="RecentAlbumMenuItem::fullSpan" ref="43fb3d3e87cfcd20190f051228134ebb" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool RecentAlbumMenuItem::fullSpan           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
no icon necessary since album image painted here 
<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00108">108</a> of file <a class="el" href="recentAlbumMenuItem_8cpp_source.html">recentAlbumMenuItem.cpp</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00109"></a>00109 { <span class="keywordflow">return</span> <span class="keyword">true</span>; }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="dbae14ce02aab6186cc91ce1a02600fc"></a><!-- doxytag: member="RecentAlbumMenuItem::paint" ref="dbae14ce02aab6186cc91ce1a02600fc" args="(QPainter *p, const QColorGroup &amp;cg, bool act, bool enabled, int x, int y, int w, int h)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RecentAlbumMenuItem::paint           </td>
          <td>(</td>
          <td class="paramtype">QPainter *&nbsp;</td>
          <td class="paramname"> <em>p</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QColorGroup &amp;&nbsp;</td>
          <td class="paramname"> <em>cg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>act</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>enabled</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>h</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
paints entry 
<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00060">60</a> of file <a class="el" href="recentAlbumMenuItem_8cpp_source.html">recentAlbumMenuItem.cpp</a>.</p>

<p>References <a class="el" href="recentAlbumMenuItem_8h_source.html#l00048">acceleratorKey</a>, <a class="el" href="recentAlbumMenuItem_8h_source.html#l00051">albumImage</a>, <a class="el" href="recentAlbumMenuItem_8h_source.html#l00054">albumName</a>, <a class="el" href="recentAlbumMenuItem_8h_source.html#l00066">idealImageWidth</a>, <a class="el" href="recentAlbumMenuItem_8h_source.html#l00063">maxWidth</a>, <a class="el" href="recentAlbumMenuItem_8h_source.html#l00057">numPhotos</a>, and <a class="el" href="recentAlbumMenuItem_8h_source.html#l00060">size</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00064"></a>00064 {
<a name="l00065"></a>00065   <span class="comment">//move down and right by two for spacing purposes</span>
<a name="l00066"></a>00066   y+=2;
<a name="l00067"></a>00067   x+=2;
<a name="l00068"></a>00068   <span class="keywordtype">int</span> xOffset = 0;
<a name="l00069"></a>00069   <span class="keywordtype">int</span> yOffset = 0;
<a name="l00070"></a>00070 
<a name="l00071"></a>00071   <span class="comment">//paint album image first if not null</span>
<a name="l00072"></a>00072   <span class="keywordflow">if</span>(!<a class="code" href="classRecentAlbumMenuItem.html#947ab36fc08c87e0997e9237ee237554" title="album image">albumImage</a>.isNull())
<a name="l00073"></a>00073   {
<a name="l00074"></a>00074     p-&gt;drawImage( x + (<a class="code" href="classRecentAlbumMenuItem.html#37540412a8fd5ee7add7ebfea246e0f7" title="used for painting purposes">idealImageWidth</a> - <a class="code" href="classRecentAlbumMenuItem.html#947ab36fc08c87e0997e9237ee237554" title="album image">albumImage</a>.width()) / 2, 
<a name="l00075"></a>00075                   y + (<a class="code" href="classRecentAlbumMenuItem.html#fa0cbaf725a37f20af94b10b02a8a73c" title="computed size">size</a>.height() - <a class="code" href="classRecentAlbumMenuItem.html#947ab36fc08c87e0997e9237ee237554" title="album image">albumImage</a>.height() - 4)/2, 
<a name="l00076"></a>00076                   <a class="code" href="classRecentAlbumMenuItem.html#947ab36fc08c87e0997e9237ee237554" title="album image">albumImage</a> );
<a name="l00077"></a>00077     xOffset+=(<a class="code" href="classRecentAlbumMenuItem.html#37540412a8fd5ee7add7ebfea246e0f7" title="used for painting purposes">idealImageWidth</a> + 2);
<a name="l00078"></a>00078   }
<a name="l00079"></a>00079   
<a name="l00080"></a>00080   <span class="comment">//paint album name + photo count</span>
<a name="l00081"></a>00081   QFontMetrics fm( qApp-&gt;font() );
<a name="l00082"></a>00082   yOffset+=fm.ascent();
<a name="l00083"></a>00083   p-&gt;drawText( x+xOffset, y+yOffset, <a class="code" href="classRecentAlbumMenuItem.html#99a2324b66081f9fda0716880905c157" title="album name">albumName</a> ); 
<a name="l00084"></a>00084 
<a name="l00085"></a>00085   <span class="comment">//if photo count available print it as well</span>
<a name="l00086"></a>00086   <span class="keywordflow">if</span>(<a class="code" href="classRecentAlbumMenuItem.html#569129eb48599392a7b8e090ad4217c9" title="number of photos">numPhotos</a>.compare(<span class="stringliteral">"-1"</span>) != 0)
<a name="l00087"></a>00087   {
<a name="l00088"></a>00088     yOffset+=fm.descent() + 1 + fm.leading() + fm.ascent();
<a name="l00089"></a>00089     p-&gt;drawText( x+xOffset, y+yOffset, 
<a name="l00090"></a>00090                qApp-&gt;translate(<span class="stringliteral">"RecentAlbumMenuItem"</span>, <span class="stringliteral">"%1 Photos"</span>).arg(<a class="code" href="classRecentAlbumMenuItem.html#569129eb48599392a7b8e090ad4217c9" title="number of photos">numPhotos</a>) );
<a name="l00091"></a>00091   }
<a name="l00092"></a>00092 
<a name="l00093"></a>00093   <span class="comment">//paint accelerator key</span>
<a name="l00094"></a>00094   <span class="keywordflow">if</span>( <a class="code" href="classRecentAlbumMenuItem.html#36498fbf466c609c7d1d7900c093682b">acceleratorKey</a> != Key_unknown )
<a name="l00095"></a>00095   {
<a name="l00096"></a>00096     xOffset = <a class="code" href="classRecentAlbumMenuItem.html#24a7b428c635dce4efe51dd27dad6cd3" title="max element width">maxWidth</a> + 24;
<a name="l00097"></a>00097     yOffset = fm.ascent() + fm.height()/2;
<a name="l00098"></a>00098     QKeySequence seq( CTRL+<a class="code" href="classRecentAlbumMenuItem.html#36498fbf466c609c7d1d7900c093682b">acceleratorKey</a> );
<a name="l00099"></a>00099     QString str = (QString)seq;
<a name="l00100"></a>00100     p-&gt;drawText( x+xOffset, y+yOffset,
<a name="l00101"></a>00101                  str);
<a name="l00102"></a>00102   }
<a name="l00103"></a>00103 }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="8fbcd4bb687b9a6ca0e1171fe0848a1f"></a><!-- doxytag: member="RecentAlbumMenuItem::setMaxWidth" ref="8fbcd4bb687b9a6ca0e1171fe0848a1f" args="(int val)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RecentAlbumMenuItem::setMaxWidth           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>val</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
after all menu items have been refreshed hint at maximum width so we can adequately position the accelerator text 
<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00111">111</a> of file <a class="el" href="recentAlbumMenuItem_8cpp_source.html">recentAlbumMenuItem.cpp</a>.</p>

<p>References <a class="el" href="recentAlbumMenuItem_8h_source.html#l00063">maxWidth</a>.</p>

<p>Referenced by <a class="el" href="titleWidget_8cpp_source.html#l01435">TitleWidget::refreshOpenRecentMenu()</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00112"></a>00112 { <a class="code" href="classRecentAlbumMenuItem.html#24a7b428c635dce4efe51dd27dad6cd3" title="max element width">maxWidth</a> = val; }
</pre></div>
<p>

</div>
</div><p>
<a class="anchor" name="42a7d14255eb18be7b52009921c4d6ad"></a><!-- doxytag: member="RecentAlbumMenuItem::sizeHint" ref="42a7d14255eb18be7b52009921c4d6ad" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QSize RecentAlbumMenuItem::sizeHint           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
returns menu entry size 
<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00105">105</a> of file <a class="el" href="recentAlbumMenuItem_8cpp_source.html">recentAlbumMenuItem.cpp</a>.</p>

<p>References <a class="el" href="recentAlbumMenuItem_8h_source.html#l00060">size</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00106"></a>00106 { <span class="keywordflow">return</span> <a class="code" href="classRecentAlbumMenuItem.html#fa0cbaf725a37f20af94b10b02a8a73c" title="computed size">size</a>; }
</pre></div>
<p>

</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="36498fbf466c609c7d1d7900c093682b"></a><!-- doxytag: member="RecentAlbumMenuItem::acceleratorKey" ref="36498fbf466c609c7d1d7900c093682b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Key <a class="el" href="classRecentAlbumMenuItem.html#36498fbf466c609c7d1d7900c093682b">RecentAlbumMenuItem::acceleratorKey</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8h_source.html#l00048">48</a> of file <a class="el" href="recentAlbumMenuItem_8h_source.html">recentAlbumMenuItem.h</a>.</p>

<p>Referenced by <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00060">paint()</a>.</p>

</div>
</div><p>
<a class="anchor" name="947ab36fc08c87e0997e9237ee237554"></a><!-- doxytag: member="RecentAlbumMenuItem::albumImage" ref="947ab36fc08c87e0997e9237ee237554" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QImage <a class="el" href="classRecentAlbumMenuItem.html#947ab36fc08c87e0997e9237ee237554">RecentAlbumMenuItem::albumImage</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
album image 
<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8h_source.html#l00051">51</a> of file <a class="el" href="recentAlbumMenuItem_8h_source.html">recentAlbumMenuItem.h</a>.</p>

<p>Referenced by <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00028">changeItem()</a>, and <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00060">paint()</a>.</p>

</div>
</div><p>
<a class="anchor" name="99a2324b66081f9fda0716880905c157"></a><!-- doxytag: member="RecentAlbumMenuItem::albumName" ref="99a2324b66081f9fda0716880905c157" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QString <a class="el" href="classRecentAlbumMenuItem.html#99a2324b66081f9fda0716880905c157">RecentAlbumMenuItem::albumName</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
album name 
<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8h_source.html#l00054">54</a> of file <a class="el" href="recentAlbumMenuItem_8h_source.html">recentAlbumMenuItem.h</a>.</p>

<p>Referenced by <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00060">paint()</a>.</p>

</div>
</div><p>
<a class="anchor" name="37540412a8fd5ee7add7ebfea246e0f7"></a><!-- doxytag: member="RecentAlbumMenuItem::idealImageWidth" ref="37540412a8fd5ee7add7ebfea246e0f7" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classRecentAlbumMenuItem.html#37540412a8fd5ee7add7ebfea246e0f7">RecentAlbumMenuItem::idealImageWidth</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
used for painting purposes 
<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8h_source.html#l00066">66</a> of file <a class="el" href="recentAlbumMenuItem_8h_source.html">recentAlbumMenuItem.h</a>.</p>

<p>Referenced by <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00028">changeItem()</a>, and <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00060">paint()</a>.</p>

</div>
</div><p>
<a class="anchor" name="24a7b428c635dce4efe51dd27dad6cd3"></a><!-- doxytag: member="RecentAlbumMenuItem::maxWidth" ref="24a7b428c635dce4efe51dd27dad6cd3" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classRecentAlbumMenuItem.html#24a7b428c635dce4efe51dd27dad6cd3">RecentAlbumMenuItem::maxWidth</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
max element width 
<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8h_source.html#l00063">63</a> of file <a class="el" href="recentAlbumMenuItem_8h_source.html">recentAlbumMenuItem.h</a>.</p>

<p>Referenced by <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00060">paint()</a>, and <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00111">setMaxWidth()</a>.</p>

</div>
</div><p>
<a class="anchor" name="569129eb48599392a7b8e090ad4217c9"></a><!-- doxytag: member="RecentAlbumMenuItem::numPhotos" ref="569129eb48599392a7b8e090ad4217c9" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QString <a class="el" href="classRecentAlbumMenuItem.html#569129eb48599392a7b8e090ad4217c9">RecentAlbumMenuItem::numPhotos</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
number of photos 
<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8h_source.html#l00057">57</a> of file <a class="el" href="recentAlbumMenuItem_8h_source.html">recentAlbumMenuItem.h</a>.</p>

<p>Referenced by <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00060">paint()</a>.</p>

</div>
</div><p>
<a class="anchor" name="fa0cbaf725a37f20af94b10b02a8a73c"></a><!-- doxytag: member="RecentAlbumMenuItem::size" ref="fa0cbaf725a37f20af94b10b02a8a73c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QSize <a class="el" href="classRecentAlbumMenuItem.html#fa0cbaf725a37f20af94b10b02a8a73c">RecentAlbumMenuItem::size</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
computed size 
<p>

<p>Definition at line <a class="el" href="recentAlbumMenuItem_8h_source.html#l00060">60</a> of file <a class="el" href="recentAlbumMenuItem_8h_source.html">recentAlbumMenuItem.h</a>.</p>

<p>Referenced by <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00028">changeItem()</a>, <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00060">paint()</a>, and <a class="el" href="recentAlbumMenuItem_8cpp_source.html#l00105">sizeHint()</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="recentAlbumMenuItem_8h_source.html">recentAlbumMenuItem.h</a><li><a class="el" href="recentAlbumMenuItem_8cpp_source.html">recentAlbumMenuItem.cpp</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 23 02:34:38 2009 for AlbumShaper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>