<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>AlbumShaper: Item 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.6.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main 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 List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div> <div class="contents"> <h1>Item Class Reference</h1><!-- doxytag: class="Item" --><!-- doxytag: inherits="QIconViewItem" --> <p><code>#include <<a class="el" href="item_8h_source.html">item.h</a>></code></p> <div class="dynheader"> Inheritance diagram for Item:</div> <div class="dynsection"> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <div class="dynheader"> Collaboration diagram for Item:</div> <div class="dynsection"> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classItem-members.html">List of all members.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classItem.html#acb7b1e10ceb5d5d00b1dbcf546f4e3e1">Item</a> (<a class="el" href="classQIconView.html">QIconView</a> *parent, QPixmap icon, QString text)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classItem.html#a0efd33bf0c9a95c2e21a32e4a7063dfe">paintItem</a> (QPainter *p, const QColorGroup &cg)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classItem.html#a2accb3b1b6178ccdf28363539b78aa93">paintFocus</a> (QPainter *, const QColorGroup &)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classItem.html#a736b672eb17d7e8b0e5ec2cdc3b02b7d">setMousedOver</a> (bool val)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classItem.html#af7fd3425634a039771f93782c345542f">setTextWidth</a> (int w)</td></tr> <tr><td colspan="2"><h2>Private Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classItem.html#aa30eb9c7628a8ba0a9c7c34ea60d3fa0">mousedOver</a></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Definition at line <a class="el" href="item_8h_source.html#l00025">25</a> of file <a class="el" href="item_8h_source.html">item.h</a>.</p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="acb7b1e10ceb5d5d00b1dbcf546f4e3e1"></a><!-- doxytag: member="Item::Item" ref="acb7b1e10ceb5d5d00b1dbcf546f4e3e1" args="(QIconView *parent, QPixmap icon, QString text)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Item::Item </td> <td>(</td> <td class="paramtype"><a class="el" href="classQIconView.html">QIconView</a> * </td> <td class="paramname"> <em>parent</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">QPixmap </td> <td class="paramname"> <em>icon</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">QString </td> <td class="paramname"> <em>text</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="item_8cpp_source.html#l00021">21</a> of file <a class="el" href="item_8cpp_source.html">item.cpp</a>.</p> <p>References <a class="el" href="item_8h_source.html#l00035">mousedOver</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00021"></a>00021 : <a class="code" href="classQIconViewItem.html">QIconViewItem</a>(parent, text, icon) <a name="l00022"></a>00022 { <a name="l00023"></a>00023 <a class="code" href="classItem.html#aa30eb9c7628a8ba0a9c7c34ea60d3fa0">mousedOver</a> = <span class="keyword">false</span>; <a name="l00024"></a>00024 } </pre></div></p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a2accb3b1b6178ccdf28363539b78aa93"></a><!-- doxytag: member="Item::paintFocus" ref="a2accb3b1b6178ccdf28363539b78aa93" args="(QPainter *, const QColorGroup &)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Item::paintFocus </td> <td>(</td> <td class="paramtype">QPainter * </td> <td class="paramname">, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const QColorGroup & </td> <td class="paramname"></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="item_8h_source.html#l00031">31</a> of file <a class="el" href="item_8h_source.html">item.h</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00031"></a>00031 { } </pre></div></p> </div> </div> <a class="anchor" id="a0efd33bf0c9a95c2e21a32e4a7063dfe"></a><!-- doxytag: member="Item::paintItem" ref="a0efd33bf0c9a95c2e21a32e4a7063dfe" args="(QPainter *p, const QColorGroup &cg)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Item::paintItem </td> <td>(</td> <td class="paramtype">QPainter * </td> <td class="paramname"> <em>p</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const QColorGroup & </td> <td class="paramname"> <em>cg</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="item_8cpp_source.html#l00026">26</a> of file <a class="el" href="item_8cpp_source.html">item.cpp</a>.</p> <p>References <a class="el" href="blur_8cpp_source.html#l00079">height</a>, and <a class="el" href="item_8h_source.html#l00035">mousedOver</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00027"></a>00027 { <a name="l00028"></a>00028 p->save(); <a name="l00029"></a>00029 QRect r = rect(); <a name="l00030"></a>00030 <a name="l00031"></a>00031 <span class="comment">//if selected paint dark blue background and outline</span> <a name="l00032"></a>00032 <span class="keywordflow">if</span>(isSelected()) <a name="l00033"></a>00033 { <a name="l00034"></a>00034 <span class="comment">//Draw Selected Color (dark blue)</span> <a name="l00035"></a>00035 p->fillRect( r, QColor(193, 210, 238) ); <a name="l00036"></a>00036 <a name="l00037"></a>00037 <span class="comment">//draw selection rectangle (darker blue)</span> <a name="l00038"></a>00038 p->setPen( QColor(49, 106, 197) ); <a name="l00039"></a>00039 p->drawRect(r); <a name="l00040"></a>00040 } <a name="l00041"></a>00041 <span class="comment">//else if pseudo selected paint ligher blue background with outline</span> <a name="l00042"></a>00042 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(<a class="code" href="classItem.html#aa30eb9c7628a8ba0a9c7c34ea60d3fa0">mousedOver</a>) <a name="l00043"></a>00043 { <a name="l00044"></a>00044 <span class="comment">//Draw Pseudo Selected Color (light blue)</span> <a name="l00045"></a>00045 p->fillRect( r, QColor(224, 232, 246) ); <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="comment">//draw selection rectangle (darker blue)</span> <a name="l00048"></a>00048 p->setPen( QColor(152, 180, 226) ); <a name="l00049"></a>00049 p->drawRect(r); <a name="l00050"></a>00050 } <a name="l00051"></a>00051 <a name="l00052"></a>00052 p->restore(); <a name="l00053"></a>00053 <a name="l00054"></a>00054 p->drawPixmap( x() , y() + ( <a class="code" href="blur_8cpp.html#ad12fc34ce789bce6c8a05d8a17138534">height</a>() - pixmap()-><a class="code" href="blur_8cpp.html#ad12fc34ce789bce6c8a05d8a17138534">height</a>() ) / 2, *pixmap()); <a name="l00055"></a>00055 <a name="l00056"></a>00056 <span class="keywordtype">int</span> align = AlignLeft | WordBreak | BreakAnywhere; <a name="l00057"></a>00057 p->drawText( textRect( FALSE ), align, text()); <a name="l00058"></a>00058 } </pre></div></p> </div> </div> <a class="anchor" id="a736b672eb17d7e8b0e5ec2cdc3b02b7d"></a><!-- doxytag: member="Item::setMousedOver" ref="a736b672eb17d7e8b0e5ec2cdc3b02b7d" args="(bool val)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Item::setMousedOver </td> <td>(</td> <td class="paramtype">bool </td> <td class="paramname"> <em>val</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="item_8cpp_source.html#l00060">60</a> of file <a class="el" href="item_8cpp_source.html">item.cpp</a>.</p> <p>References <a class="el" href="item_8h_source.html#l00035">mousedOver</a>.</p> <p>Referenced by <a class="el" href="items_8cpp_source.html#l00078">Items::clearPseudoSelection()</a>, and <a class="el" href="items_8cpp_source.html#l00067">Items::repaintGroup()</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00061"></a>00061 { <a class="code" href="classItem.html#aa30eb9c7628a8ba0a9c7c34ea60d3fa0">mousedOver</a> = val; } </pre></div></p> </div> </div> <a class="anchor" id="af7fd3425634a039771f93782c345542f"></a><!-- doxytag: member="Item::setTextWidth" ref="af7fd3425634a039771f93782c345542f" args="(int w)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Item::setTextWidth </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>w</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="item_8cpp_source.html#l00063">63</a> of file <a class="el" href="item_8cpp_source.html">item.cpp</a>.</p> <p>References <a class="el" href="blur_8cpp_source.html#l00079">height</a>, and <a class="el" href="redEye__internal_8h_source.html#l00042">topLeft</a>.</p> <p><div class="fragment"><pre class="fragment"><a name="l00064"></a>00064 { <a name="l00065"></a>00065 QRect pr = pixmapRect(); <a name="l00066"></a>00066 pr.moveBy( 3, 3 ); <a name="l00067"></a>00067 setPixmapRect( pr ); <a name="l00068"></a>00068 <a name="l00069"></a>00069 QRect tr = textRect(); <a name="l00070"></a>00070 tr.moveBy( 3, 3 ); <a name="l00071"></a>00071 tr.setRight( tr.left() + w); <a name="l00072"></a>00072 setTextRect( tr ); <a name="l00073"></a>00073 <a name="l00074"></a>00074 <span class="keywordtype">int</span> newW = pixmapRect().width() + 6 + w; <a name="l00075"></a>00075 <span class="keywordtype">int</span> newH = QMAX( textRect().<a class="code" href="blur_8cpp.html#ad12fc34ce789bce6c8a05d8a17138534">height</a>(), pixmapRect().<a class="code" href="blur_8cpp.html#ad12fc34ce789bce6c8a05d8a17138534">height</a>() ) + 6; <a name="l00076"></a>00076 <a name="l00077"></a>00077 setItemRect( QRect( rect().<a class="code" href="redEye__internal_8h.html#a6a9aebec61b1a6732045c187a6156f4f">topLeft</a>(), QSize(newW, newH)) ); <a name="l00078"></a>00078 } </pre></div></p> </div> </div> <hr/><h2>Member Data Documentation</h2> <a class="anchor" id="aa30eb9c7628a8ba0a9c7c34ea60d3fa0"></a><!-- doxytag: member="Item::mousedOver" ref="aa30eb9c7628a8ba0a9c7c34ea60d3fa0" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="classItem.html#aa30eb9c7628a8ba0a9c7c34ea60d3fa0">Item::mousedOver</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="item_8h_source.html#l00035">35</a> of file <a class="el" href="item_8h_source.html">item.h</a>.</p> <p>Referenced by <a class="el" href="item_8cpp_source.html#l00021">Item()</a>, <a class="el" href="item_8cpp_source.html#l00026">paintItem()</a>, and <a class="el" href="item_8cpp_source.html#l00060">setMousedOver()</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="item_8h_source.html">item.h</a></li> <li><a class="el" href="item_8cpp_source.html">item.cpp</a></li> </ul> </div> <hr size="1"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> </body> </html>