<!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>Qwt User's Guide: qwt_dial_needle.h Source File</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.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Qwt User's Guide <span id="projectnumber">6.0.1</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <h1>qwt_dial_needle.h</h1> </div> </div> <div class="contents"> <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************</span> <a name="l00002"></a>00002 <span class="comment"> * Qwt Widget Library</span> <a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1997 Josef Wilgen</span> <a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002 Uwe Rathmann</span> <a name="l00005"></a>00005 <span class="comment"> *</span> <a name="l00006"></a>00006 <span class="comment"> * This library is free software; you can redistribute it and/or</span> <a name="l00007"></a>00007 <span class="comment"> * modify it under the terms of the Qwt License, Version 1.0</span> <a name="l00008"></a>00008 <span class="comment"> *****************************************************************************/</span> <a name="l00009"></a>00009 <a name="l00010"></a>00010 <span class="preprocessor">#ifndef QWT_DIAL_NEEDLE_H</span> <a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define QWT_DIAL_NEEDLE_H 1</span> <a name="l00012"></a>00012 <span class="preprocessor"></span> <a name="l00013"></a>00013 <span class="preprocessor">#include "qwt_global.h"</span> <a name="l00014"></a>00014 <span class="preprocessor">#include <qpalette.h></span> <a name="l00015"></a>00015 <a name="l00016"></a>00016 <span class="keyword">class </span>QPainter; <a name="l00017"></a>00017 <span class="keyword">class </span>QPoint; <a name="l00018"></a>00018 <a name="l00031"></a><a class="code" href="class_qwt_dial_needle.html">00031</a> <span class="keyword">class </span>QWT_EXPORT <a class="code" href="class_qwt_dial_needle.html" title="Base class for needles that can be used in a QwtDial.">QwtDialNeedle</a> <a name="l00032"></a>00032 { <a name="l00033"></a>00033 <span class="keyword">public</span>: <a name="l00034"></a>00034 <a class="code" href="class_qwt_dial_needle.html" title="Base class for needles that can be used in a QwtDial.">QwtDialNeedle</a>(); <a name="l00035"></a>00035 <span class="keyword">virtual</span> ~<a class="code" href="class_qwt_dial_needle.html" title="Base class for needles that can be used in a QwtDial.">QwtDialNeedle</a>(); <a name="l00036"></a>00036 <a name="l00037"></a>00037 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setPalette( <span class="keyword">const</span> QPalette & ); <a name="l00038"></a>00038 <span class="keyword">const</span> QPalette &palette() <span class="keyword">const</span>; <a name="l00039"></a>00039 <a name="l00040"></a>00040 <span class="keyword">virtual</span> <span class="keywordtype">void</span> draw( QPainter *painter, <span class="keyword">const</span> QPointF &center, <a name="l00041"></a>00041 <span class="keywordtype">double</span> length, <span class="keywordtype">double</span> direction, <a name="l00042"></a>00042 QPalette::ColorGroup = QPalette::Active ) <span class="keyword">const</span>; <a name="l00043"></a>00043 <a name="l00044"></a>00044 <span class="keyword">protected</span>: <a name="l00060"></a>00060 <span class="keyword">virtual</span> <span class="keywordtype">void</span> drawNeedle( QPainter *painter, <a name="l00061"></a>00061 <span class="keywordtype">double</span> length, QPalette::ColorGroup colorGroup ) <span class="keyword">const</span> = 0; <a name="l00062"></a>00062 <a name="l00063"></a>00063 <span class="keyword">virtual</span> <span class="keywordtype">void</span> drawKnob( QPainter *, <span class="keywordtype">double</span> width, <a name="l00064"></a>00064 <span class="keyword">const</span> QBrush &, <span class="keywordtype">bool</span> sunken ) <span class="keyword">const</span>; <a name="l00065"></a>00065 <a name="l00066"></a>00066 <span class="keyword">private</span>: <a name="l00067"></a>00067 QPalette d_palette; <a name="l00068"></a>00068 }; <a name="l00069"></a>00069 <a name="l00083"></a><a class="code" href="class_qwt_dial_simple_needle.html">00083</a> <span class="keyword">class </span>QWT_EXPORT <a class="code" href="class_qwt_dial_simple_needle.html" title="A needle for dial widgets.">QwtDialSimpleNeedle</a>: <span class="keyword">public</span> <a class="code" href="class_qwt_dial_needle.html" title="Base class for needles that can be used in a QwtDial.">QwtDialNeedle</a> <a name="l00084"></a>00084 { <a name="l00085"></a>00085 <span class="keyword">public</span>: <a name="l00087"></a><a class="code" href="class_qwt_dial_simple_needle.html#ad28821489e04f1fd942e5bebc8a60584">00087</a> <span class="keyword">enum</span> <a class="code" href="class_qwt_dial_simple_needle.html#ad28821489e04f1fd942e5bebc8a60584" title="Style of the needle.">Style</a> <a name="l00088"></a>00088 { <a name="l00090"></a><a class="code" href="class_qwt_dial_simple_needle.html#ad28821489e04f1fd942e5bebc8a60584a27ace220f0a5c6abd061c85bbdc9a663">00090</a> <a class="code" href="class_qwt_dial_simple_needle.html#ad28821489e04f1fd942e5bebc8a60584a27ace220f0a5c6abd061c85bbdc9a663" title="Arrow.">Arrow</a>, <a name="l00091"></a>00091 <a name="l00093"></a><a class="code" href="class_qwt_dial_simple_needle.html#ad28821489e04f1fd942e5bebc8a60584a580980e68ef26fc7d35962cf6f12a4b2">00093</a> Ray <a name="l00094"></a>00094 }; <a name="l00095"></a>00095 <a name="l00096"></a>00096 <a class="code" href="class_qwt_dial_simple_needle.html" title="A needle for dial widgets.">QwtDialSimpleNeedle</a>( Style, <span class="keywordtype">bool</span> hasKnob = <span class="keyword">true</span>, <a name="l00097"></a>00097 <span class="keyword">const</span> QColor &mid = Qt::gray, <span class="keyword">const</span> QColor &base = Qt::darkGray ); <a name="l00098"></a>00098 <a name="l00099"></a>00099 <span class="keywordtype">void</span> setWidth( <span class="keywordtype">double</span> width ); <a name="l00100"></a>00100 <span class="keywordtype">double</span> width() <span class="keyword">const</span>; <a name="l00101"></a>00101 <a name="l00102"></a>00102 <span class="keyword">protected</span>: <a name="l00103"></a>00103 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_qwt_dial_needle.html#a1e4fee366fec1838edc18890d9957f2b" title="Draw the needle.">drawNeedle</a>( QPainter *, <span class="keywordtype">double</span> length, <a name="l00104"></a>00104 QPalette::ColorGroup ) <span class="keyword">const</span>; <a name="l00105"></a>00105 <a name="l00106"></a>00106 <span class="keyword">private</span>: <a name="l00107"></a>00107 Style d_style; <a name="l00108"></a>00108 <span class="keywordtype">bool</span> d_hasKnob; <a name="l00109"></a>00109 <span class="keywordtype">double</span> d_width; <a name="l00110"></a>00110 }; <a name="l00111"></a>00111 <a name="l00129"></a><a class="code" href="class_qwt_compass_magnet_needle.html">00129</a> <span class="keyword">class </span>QWT_EXPORT <a class="code" href="class_qwt_compass_magnet_needle.html" title="A magnet needle for compass widgets.">QwtCompassMagnetNeedle</a>: <span class="keyword">public</span> <a class="code" href="class_qwt_dial_needle.html" title="Base class for needles that can be used in a QwtDial.">QwtDialNeedle</a> <a name="l00130"></a>00130 { <a name="l00131"></a>00131 <span class="keyword">public</span>: <a name="l00133"></a><a class="code" href="class_qwt_compass_magnet_needle.html#aee1d882c6ec8b680b94b59b5710a92a5">00133</a> <span class="keyword">enum</span> <a class="code" href="class_qwt_compass_magnet_needle.html#aee1d882c6ec8b680b94b59b5710a92a5" title="Style of the needle.">Style</a> <a name="l00134"></a>00134 { <a name="l00136"></a><a class="code" href="class_qwt_compass_magnet_needle.html#aee1d882c6ec8b680b94b59b5710a92a5ad2ba960c4dae88e36da39f6b62798f3b">00136</a> <a class="code" href="class_qwt_compass_magnet_needle.html#aee1d882c6ec8b680b94b59b5710a92a5ad2ba960c4dae88e36da39f6b62798f3b" title="A needle with a triangular shape.">TriangleStyle</a>, <a name="l00137"></a>00137 <a name="l00139"></a><a class="code" href="class_qwt_compass_magnet_needle.html#aee1d882c6ec8b680b94b59b5710a92a5ab63a2dd26ef14c2aaf9763bc24a8bdac">00139</a> ThinStyle <a name="l00140"></a>00140 }; <a name="l00141"></a>00141 <a name="l00142"></a>00142 <a class="code" href="class_qwt_compass_magnet_needle.html" title="A magnet needle for compass widgets.">QwtCompassMagnetNeedle</a>( Style = TriangleStyle, <a name="l00143"></a>00143 <span class="keyword">const</span> QColor &light = Qt::white, <span class="keyword">const</span> QColor &dark = Qt::red ); <a name="l00144"></a>00144 <a name="l00145"></a>00145 <span class="keyword">protected</span>: <a name="l00146"></a>00146 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_qwt_dial_needle.html#a1e4fee366fec1838edc18890d9957f2b" title="Draw the needle.">drawNeedle</a>( QPainter *, <a name="l00147"></a>00147 <span class="keywordtype">double</span> length, QPalette::ColorGroup ) <span class="keyword">const</span>; <a name="l00148"></a>00148 <a name="l00149"></a>00149 <span class="keyword">private</span>: <a name="l00150"></a>00150 Style d_style; <a name="l00151"></a>00151 }; <a name="l00152"></a>00152 <a name="l00166"></a><a class="code" href="class_qwt_compass_wind_arrow.html">00166</a> <span class="keyword">class </span>QWT_EXPORT <a class="code" href="class_qwt_compass_wind_arrow.html" title="An indicator for the wind direction.">QwtCompassWindArrow</a>: <span class="keyword">public</span> <a class="code" href="class_qwt_dial_needle.html" title="Base class for needles that can be used in a QwtDial.">QwtDialNeedle</a> <a name="l00167"></a>00167 { <a name="l00168"></a>00168 <span class="keyword">public</span>: <a name="l00170"></a><a class="code" href="class_qwt_compass_wind_arrow.html#a55f11e28c9d87c0fb7c306ccd174f2a8">00170</a> <span class="keyword">enum</span> <a class="code" href="class_qwt_compass_wind_arrow.html#a55f11e28c9d87c0fb7c306ccd174f2a8" title="Style of the arrow.">Style</a> <a name="l00171"></a>00171 { <a name="l00173"></a><a class="code" href="class_qwt_compass_wind_arrow.html#a55f11e28c9d87c0fb7c306ccd174f2a8a62b689f03b4e974660ce1241942b09fc">00173</a> <a class="code" href="class_qwt_compass_wind_arrow.html#a55f11e28c9d87c0fb7c306ccd174f2a8a62b689f03b4e974660ce1241942b09fc" title="A needle pointing to the center.">Style1</a>, <a name="l00174"></a>00174 <a name="l00176"></a><a class="code" href="class_qwt_compass_wind_arrow.html#a55f11e28c9d87c0fb7c306ccd174f2a8a44a462b3f0fa85bf3fa8dc421484e529">00176</a> Style2 <a name="l00177"></a>00177 }; <a name="l00178"></a>00178 <a name="l00179"></a>00179 <a class="code" href="class_qwt_compass_wind_arrow.html" title="An indicator for the wind direction.">QwtCompassWindArrow</a>( Style, <span class="keyword">const</span> QColor &light = Qt::white, <a name="l00180"></a>00180 <span class="keyword">const</span> QColor &dark = Qt::gray ); <a name="l00181"></a>00181 <a name="l00182"></a>00182 <span class="keyword">protected</span>: <a name="l00183"></a>00183 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_qwt_dial_needle.html#a1e4fee366fec1838edc18890d9957f2b" title="Draw the needle.">drawNeedle</a>( QPainter *, <a name="l00184"></a>00184 <span class="keywordtype">double</span> length, QPalette::ColorGroup ) <span class="keyword">const</span>; <a name="l00185"></a>00185 <a name="l00186"></a>00186 <span class="keyword">private</span>: <a name="l00187"></a>00187 Style d_style; <a name="l00188"></a>00188 }; <a name="l00189"></a>00189 <a name="l00190"></a>00190 <span class="preprocessor">#endif </span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address> </body> </html>