📄 class_qwt_analog_clock.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Qwt User's Guide: QwtAnalogClock Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.4.6 --><div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li id="current"><a href="classes.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul></div><div class="tabs"> <ul> <li><a href="classes.html"><span>Alphabetical List</span></a></li> <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><h1>QwtAnalogClock Class Reference</h1><!-- doxytag: class="QwtAnalogClock" --><!-- doxytag: inherits="QwtDial" -->Inheritance diagram for QwtAnalogClock:<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 href="class_qwt_dial.html" shape="rect" coords="37,157,104,181" alt=""><area href="class_qwt_abstract_slider.html" shape="rect" coords="7,83,135,107" alt=""><area href="class_qwt_double_range.html" shape="rect" coords="8,8,133,32" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for QwtAnalogClock:<p><center><img src="class_qwt_analog_clock__coll__graph.png" border="0" usemap="#_qwt_analog_clock__coll__map" alt="Collaboration graph"></center><map name="_qwt_analog_clock__coll__map"><area href="class_qwt_dial.html" shape="rect" coords="37,163,104,187" alt=""><area href="class_qwt_abstract_slider.html" shape="rect" coords="7,85,135,109" alt=""><area href="class_qwt_double_range.html" shape="rect" coords="8,8,133,32" alt=""><area href="class_qwt_dial_needle.html" shape="rect" coords="128,163,237,187" alt=""></map><center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_qwt_analog_clock-members.html">List of all members.</a><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 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 compact><dt><b>Note:</b></dt><dd>The examples/dials example shows how to use <a class="el" href="class_qwt_analog_clock.html">QwtAnalogClock</a>. </dd></dl><p><p>Definition at line <a class="el" href="qwt__analog__clock_8h-source.html#l00045">45</a> of file <a class="el" href="qwt__analog__clock_8h-source.html">qwt_analog_clock.h</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><h2>Member Enumeration Documentation</h2><a class="anchor" name="cd8f7e963ae073120684de46821f2cfe"></a><!-- doxytag: member="QwtAnalogClock::Hand" ref="cd8f7e963ae073120684de46821f2cfe" args="" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">enum <a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">QwtAnalogClock::Hand</a> </td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Hand type <dl 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><p>Definition at line <a class="el" href="qwt__analog__clock_8h-source.html#l00055">55</a> of file <a class="el" href="qwt__analog__clock_8h-source.html">qwt_analog_clock.h</a>. </td> </tr></table><hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="f52a1110f1db89c162f49a23772745b9"></a><!-- doxytag: member="QwtAnalogClock::QwtAnalogClock" ref="f52a1110f1db89c162f49a23772745b9" args="(QWidget *parent=NULL)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">QwtAnalogClock::QwtAnalogClock </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">QWidget * </td> <td class="mdname1" valign="top" nowrap> <em>parent</em> = <code>NULL</code> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [explicit]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><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><p>Definition at line <a class="el" href="qwt__analog__clock_8cpp-source.html#l00016">16</a> of file <a class="el" href="qwt__analog__clock_8cpp-source.html">qwt_analog_clock.cpp</a>. </td> </tr></table><a class="anchor" name="3abdcecf88e3d3510d94e96e7e9e74ee"></a><!-- doxytag: member="QwtAnalogClock::~QwtAnalogClock" ref="3abdcecf88e3d3510d94e96e7e9e74ee" args="()" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">QwtAnalogClock::~QwtAnalogClock </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Destructor. <p><p>Definition at line <a class="el" href="qwt__analog__clock_8cpp-source.html#l00082">82</a> of file <a class="el" href="qwt__analog__clock_8cpp-source.html">qwt_analog_clock.cpp</a>. </td> </tr></table><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 " --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void QwtAnalogClock::drawHand </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">QPainter * </td> <td class="mdname" nowrap> <em>painter</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="class_qwt_analog_clock.html#cd8f7e963ae073120684de46821f2cfe">Hand</a> </td> <td class="mdname" nowrap> <em>hd</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const QPoint & </td> <td class="mdname" nowrap> <em>center</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>radius</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>double </td> <td class="mdname" nowrap> <em>direction</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>QPalette::ColorGroup </td> <td class="mdname" nowrap> <em>cg</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"> const<code> [protected, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><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><p>Definition at line <a class="el" href="qwt__analog__clock_8cpp-source.html#l00220">220</a> of file <a class="el" href="qwt__analog__clock_8cpp-source.html">qwt_analog_clock.cpp</a>.<p>References <a class="el" href="class_qwt_dial_needle.html#6076eecfa9fc39235435d098cf146a2c">QwtDialNeedle::draw()</a>, <a class="el" href="qwt__analog__clock_8cpp-source.html#l00131">hand()</a>, and <a class="el" href="qwt__dial_8cpp-source.html#l00787">QwtDial::needle()</a>.<p>Referenced by <a class="el" href="qwt__analog__clock_8cpp-source.html#l00191">drawNeedle()</a>. </td> </tr></table><a class="anchor" name="1015d53a224d9d6a8b3599d8438143d4"></a><!-- doxytag: member="QwtAnalogClock::drawNeedle" ref="1015d53a224d9d6a8b3599d8438143d4" args="(QPainter *, const QPoint &, int radius, double direction, QPalette::ColorGroup) const " --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void QwtAnalogClock::drawNeedle </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">QPainter * </td> <td class="mdname" nowrap> <em>painter</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const QPoint & </td> <td class="mdname" nowrap> <em>center</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>radius</em>, </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -