<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>Qwt User's Guide: QwtAnalogClock 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.8 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</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="classes.html"><span>Class Index</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>QwtAnalogClock Class Reference</h1><!-- doxytag: class="QwtAnalogClock" --><!-- doxytag: inherits="QwtDial" -->An analog clock. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="qwt__analog__clock_8h-source.html">qwt_analog_clock.h</a>></code> <p> <div class="dynheader"> Inheritance diagram for QwtAnalogClock:</div> <div class="dynsection"> <p><center><img src="class_qwt_analog_clock__inherit__graph.png" border="0" usemap="#_qwt_analog_clock__inherit__map" alt="Inheritance graph"></center> <map name="_qwt_analog_clock__inherit__map"> <area shape="rect" href="class_qwt_dial.html" title="QwtDial class provides a rounded range control." alt="" coords="36,157,105,181"><area shape="rect" href="class_qwt_abstract_slider.html" title="An abstract base class for slider widgets." alt="" coords="7,83,135,107"><area shape="rect" href="class_qwt_double_range.html" title="A class which controls a value within an interval." alt="" coords="8,8,133,32"></map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div> <p> <a href="class_qwt_analog_clock-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 Types</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">Hand</a> { <br> <b>SecondHand</b>, <br> <b>MinuteHand</b>, <br> <b>HourHand</b>, <br> <b>NHands</b> <br> }</td></tr> <tr><td colspan="2"><br><h2>Public Slots</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_analog_clock.html#1972a54ce59155ec7435103f11a775a7">setCurrentTime</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_analog_clock.html#7a7098a41511a4b1c819cfc8b0f2839c">setTime</a> (const QTime &=QTime::currentTime())</td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_analog_clock.html#f52a1110f1db89c162f49a23772745b9">QwtAnalogClock</a> (QWidget *parent=NULL)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_analog_clock.html#3abdcecf88e3d3510d94e96e7e9e74ee">~QwtAnalogClock</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_analog_clock.html#643101aafbe7a6fc91cb550203a7d3ee">setHand</a> (<a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">Hand</a>, <a class="el" href="class_qwt_dial_needle.html">QwtDialNeedle</a> *)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="class_qwt_dial_needle.html">QwtDialNeedle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_analog_clock.html#b390561b0856eef0d2bb80bdff0fb204">hand</a> (<a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">Hand</a>) const </td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="class_qwt_dial_needle.html">QwtDialNeedle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_analog_clock.html#bb93bf8255bc00ef160165385bb6adce">hand</a> (<a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">Hand</a>)</td></tr> <tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="class_qwt_text.html">QwtText</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_analog_clock.html#c41f420214578dfebbd8a6216105e510">scaleLabel</a> (double) const </td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_analog_clock.html#1015d53a224d9d6a8b3599d8438143d4">drawNeedle</a> (QPainter *, const QPoint &, int radius, double direction, QPalette::ColorGroup) const </td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_analog_clock.html#de068366d6b8fb1d706e2bec32fc5004">drawHand</a> (QPainter *, <a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">Hand</a>, const QPoint &, int radius, double direction, QPalette::ColorGroup) const </td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> An analog clock. <p> <div align="center"> <img src="analogclock.png" alt="analogclock.png"> </div> <p> <dl class="user" compact><dt><b>Example</b></dt><dd><div class="fragment"><pre class="fragment">#include <qwt_analog_clock.h> QwtAnalogClock *clock = new QwtAnalogClock(...); clock->scaleDraw()->setPenWidth(3); clock->setLineWidth(6); clock->setFrameShadow(QwtDial::Sunken); clock->setTime(); // update the clock every second QTimer *timer = new QTimer(clock); timer->connect(timer, SIGNAL(timeout()), clock, SLOT(setCurrentTime())); timer->start(1000); </pre></div></dd></dl> Qwt is missing a set of good looking hands. Contributions are very welcome.<p> <dl class="note" compact><dt><b>Note:</b></dt><dd>The examples/dials example shows how to use <a class="el" href="class_qwt_analog_clock.html" title="An analog clock.">QwtAnalogClock</a>. </dd></dl> <hr><h2>Member Enumeration Documentation</h2> <a class="anchor" name="cd8f7e963ae073120684de46821f2cfe"></a><!-- doxytag: member="QwtAnalogClock::Hand" ref="cd8f7e963ae073120684de46821f2cfe" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">QwtAnalogClock::Hand</a> </td> </tr> </table> </div> <div class="memdoc"> <p> Hand type <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_analog_clock.html#643101aafbe7a6fc91cb550203a7d3ee">setHand()</a>, <a class="el" href="class_qwt_analog_clock.html#b390561b0856eef0d2bb80bdff0fb204">hand()</a> </dd></dl> </div> </div><p> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="f52a1110f1db89c162f49a23772745b9"></a><!-- doxytag: member="QwtAnalogClock::QwtAnalogClock" ref="f52a1110f1db89c162f49a23772745b9" args="(QWidget *parent=NULL)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">QwtAnalogClock::QwtAnalogClock </td> <td>(</td> <td class="paramtype">QWidget * </td> <td class="paramname"> <em>parent</em> = <code>NULL</code> </td> <td> ) </td> <td><code> [explicit]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Constructor <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>parent</em> </td><td>Parent widget </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="3abdcecf88e3d3510d94e96e7e9e74ee"></a><!-- doxytag: member="QwtAnalogClock::~QwtAnalogClock" ref="3abdcecf88e3d3510d94e96e7e9e74ee" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">QwtAnalogClock::~QwtAnalogClock </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Destructor. <p> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="de068366d6b8fb1d706e2bec32fc5004"></a><!-- doxytag: member="QwtAnalogClock::drawHand" ref="de068366d6b8fb1d706e2bec32fc5004" args="(QPainter *, Hand, const QPoint &, int radius, double direction, QPalette::ColorGroup) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void QwtAnalogClock::drawHand </td> <td>(</td> <td class="paramtype">QPainter * </td> <td class="paramname"> <em>painter</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">Hand</a> </td> <td class="paramname"> <em>hd</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const QPoint & </td> <td class="paramname"> <em>center</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>radius</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>direction</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">QPalette::ColorGroup </td> <td class="paramname"> <em>cg</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td> const<code> [protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Draw a clock hand<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>painter</em> </td><td>Painter </td></tr> <tr><td valign="top"></td><td valign="top"><em>hd</em> </td><td>Specify the type of hand </td></tr> <tr><td valign="top"></td><td valign="top"><em>center</em> </td><td>Center of the clock </td></tr> <tr><td valign="top"></td><td valign="top"><em>radius</em> </td><td>Maximum length for the hands </td></tr> <tr><td valign="top"></td><td valign="top"><em>direction</em> </td><td>Direction of the hand in degrees, counter clockwise </td></tr> <tr><td valign="top"></td><td valign="top"><em>cg</em> </td><td>ColorGroup </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="1015d53a224d9d6a8b3599d8438143d4"></a><!-- doxytag: member="QwtAnalogClock::drawNeedle" ref="1015d53a224d9d6a8b3599d8438143d4" args="(QPainter *, const QPoint &, int radius, double direction, QPalette::ColorGroup) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void QwtAnalogClock::drawNeedle </td> <td>(</td> <td class="paramtype">QPainter * </td> <td class="paramname"> <em>painter</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const QPoint & </td> <td class="paramname"> <em>center</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>radius</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>direction</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">QPalette::ColorGroup </td> <td class="paramname"> <em>cg</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td> const<code> [protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Draw the needle. <p> A clock has no single needle but three hands instead. drawNeedle translates <a class="el" href="class_qwt_double_range.html#7777cf257c812579c4891512f1b6cad0" title="Returns the current value.">value()</a> into directions for the hands and calls <a class="el" href="class_qwt_analog_clock.html#de068366d6b8fb1d706e2bec32fc5004">drawHand()</a>.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>painter</em> </td><td>Painter </td></tr> <tr><td valign="top"></td><td valign="top"><em>center</em> </td><td>Center of the clock </td></tr> <tr><td valign="top"></td><td valign="top"><em>radius</em> </td><td>Maximum length for the hands </td></tr> <tr><td valign="top"></td><td valign="top"><em>direction</em> </td><td>Dummy, not used. </td></tr> <tr><td valign="top"></td><td valign="top"><em>cg</em> </td><td>ColorGroup</td></tr> </table> </dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_analog_clock.html#de068366d6b8fb1d706e2bec32fc5004">drawHand()</a> </dd></dl> <p>Reimplemented from <a class="el" href="class_qwt_dial.html#c6d173aed044964a21366bcdc34ae212">QwtDial</a>.</p> </div> </div><p> <a class="anchor" name="bb93bf8255bc00ef160165385bb6adce"></a><!-- doxytag: member="QwtAnalogClock::hand" ref="bb93bf8255bc00ef160165385bb6adce" args="(Hand)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_qwt_dial_needle.html">QwtDialNeedle</a> * QwtAnalogClock::hand </td> <td>(</td> <td class="paramtype"><a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">Hand</a> </td> <td class="paramname"> <em>hd</em> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>Clock hand </dd></dl> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hd</em> </td><td>Specifies the type of hand </td></tr> </table> </dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_analog_clock.html#643101aafbe7a6fc91cb550203a7d3ee">setHand()</a> </dd></dl> </div> </div><p> <a class="anchor" name="b390561b0856eef0d2bb80bdff0fb204"></a><!-- doxytag: member="QwtAnalogClock::hand" ref="b390561b0856eef0d2bb80bdff0fb204" args="(Hand) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="class_qwt_dial_needle.html">QwtDialNeedle</a> * QwtAnalogClock::hand </td> <td>(</td> <td class="paramtype"><a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">Hand</a> </td> <td class="paramname"> <em>hd</em> </td> <td> ) </td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>Clock hand </dd></dl> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hd</em> </td><td>Specifies the type of hand </td></tr> </table> </dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_analog_clock.html#643101aafbe7a6fc91cb550203a7d3ee">setHand()</a> </dd></dl> </div> </div><p> <a class="anchor" name="c41f420214578dfebbd8a6216105e510"></a><!-- doxytag: member="QwtAnalogClock::scaleLabel" ref="c41f420214578dfebbd8a6216105e510" args="(double) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="class_qwt_text.html">QwtText</a> QwtAnalogClock::scaleLabel </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>value</em> </td> <td> ) </td> <td> const<code> [protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Find the scale label for a given value<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>value</em> </td><td>Value </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>Label </dd></dl> <p>Reimplemented from <a class="el" href="class_qwt_dial.html#b91f5aa6c54349d735fe22acd4f5a2e1">QwtDial</a>.</p> </div> </div><p> <a class="anchor" name="1972a54ce59155ec7435103f11a775a7"></a><!-- doxytag: member="QwtAnalogClock::setCurrentTime" ref="1972a54ce59155ec7435103f11a775a7" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void QwtAnalogClock::setCurrentTime </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [slot]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Set the current time. <p> This is the same as <a class="el" href="class_qwt_analog_clock.html#7a7098a41511a4b1c819cfc8b0f2839c">QwtAnalogClock::setTime()</a>, but Qt < 3.0 can't handle default parameters for slots. </div> </div><p> <a class="anchor" name="643101aafbe7a6fc91cb550203a7d3ee"></a><!-- doxytag: member="QwtAnalogClock::setHand" ref="643101aafbe7a6fc91cb550203a7d3ee" args="(Hand, QwtDialNeedle *)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void QwtAnalogClock::setHand </td> <td>(</td> <td class="paramtype"><a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">Hand</a> </td> <td class="paramname"> <em>hand</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="class_qwt_dial_needle.html">QwtDialNeedle</a> * </td> <td class="paramname"> <em>needle</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Set a clockhand <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hand</em> </td><td>Specifies the type of hand </td></tr> <tr><td valign="top"></td><td valign="top"><em>needle</em> </td><td>Hand </td></tr> </table> </dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_analog_clock.html#b390561b0856eef0d2bb80bdff0fb204">hand()</a> </dd></dl> </div> </div><p> <a class="anchor" name="7a7098a41511a4b1c819cfc8b0f2839c"></a><!-- doxytag: member="QwtAnalogClock::setTime" ref="7a7098a41511a4b1c819cfc8b0f2839c" args="(const QTime &=QTime::currentTime())" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void QwtAnalogClock::setTime </td> <td>(</td> <td class="paramtype">const QTime & </td> <td class="paramname"> <em>time</em> = <code>QTime::currentTime()</code> </td> <td> ) </td> <td><code> [slot]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Set a time <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>time</em> </td><td>Time to display </td></tr> </table> </dl> </div> </div><p> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Sun Mar 22 16:41:19 2009 for Qwt User's Guide by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> </body> </html>