1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDial Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDial Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QDial class provides a rounded range control (like a speedometer or potentiometer). <a href="#details">More...</a></p>
<p>Inherits <a href="qabstractslider.html">QAbstractSlider</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdial.html#QDial">__init__</a></b> (<i>self</i>, QWidget <i>parent</i> = None)</li><li><div class="fn" />bool <b><a href="qdial.html#event">event</a></b> (<i>self</i>, QEvent <i>e</i>)</li><li><div class="fn" />QSize <b><a href="qdial.html#minimumSizeHint">minimumSizeHint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdial.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QMouseEvent <i>me</i>)</li><li><div class="fn" /><b><a href="qdial.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent <i>me</i>)</li><li><div class="fn" /><b><a href="qdial.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QMouseEvent <i>me</i>)</li><li><div class="fn" />bool <b><a href="qdial.html#notchesVisible">notchesVisible</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdial.html#notchSize">notchSize</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qdial.html#notchTarget">notchTarget</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdial.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent <i>pe</i>)</li><li><div class="fn" /><b><a href="qdial.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent <i>re</i>)</li><li><div class="fn" /><b><a href="qdial.html#setNotchesVisible">setNotchesVisible</a></b> (<i>self</i>, bool <i>visible</i>)</li><li><div class="fn" /><b><a href="qdial.html#setNotchTarget">setNotchTarget</a></b> (<i>self</i>, float <i>target</i>)</li><li><div class="fn" /><b><a href="qdial.html#setWrapping">setWrapping</a></b> (<i>self</i>, bool <i>on</i>)</li><li><div class="fn" />QSize <b><a href="qdial.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdial.html#sliderChange">sliderChange</a></b> (<i>self</i>, QAbstractSlider.SliderChange <i>change</i>)</li><li><div class="fn" />bool <b><a href="qdial.html#wrapping">wrapping</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDial class provides a rounded range control (like a speedometer or potentiometer).</p>
<p>QDial is used when the user needs to control a value within a program-definable range, and the range either wraps around (typically, 0..359 degrees) or the dialog layout needs a square widget.</p>
<p>Both API- and UI-wise, the dial is very similar to a <a href="qslider.html">slider.</a> Indeed, when <a href="qdial.html#wrapping-prop">wrapping</a>() is false (the default) there is no real difference between a slider and a dial. They have the same signals, slots and member functions, all of which do the same things. Which one you use depends only on your taste and on the application.</p>
<p>The dial initially emits <a href="qabstractslider.html#valueChanged">valueChanged</a>() signals continuously while the slider is being moved; you can make it emit the signal less often by calling setTracking(false). <a href="qdial-qt3.html#dialMoved">dialMoved</a>() is emitted continuously even when tracking() is false.</p>
<p>The slider also emits <a href="qdial-qt3.html#dialPressed">dialPressed</a>() and <a href="qdial-qt3.html#dialReleased">dialReleased</a>() signals when the mouse button is pressed and released. But note that the dial's value can change without these signals being emitted; the keyboard and wheel can be used to change the value.</p>
<p>Unlike the slider, QDial attempts to draw a "nice" number of notches rather than one per <a href="qabstractslider-qt3.html#lineStepx">lineStep</a>(). If possible, the number of notches drawn is one per <a href="qabstractslider-qt3.html#lineStepx">lineStep</a>(), but if there aren't enough pixels to draw every one, QDial will draw every second, third etc., notch. <a href="qdial.html#notchSize-prop">notchSize</a>() returns the number of units per notch, hopefully a multiple of <a href="qabstractslider-qt3.html#lineStepx">lineStep</a>(); <a href="qdial.html#notchTarget-prop">setNotchTarget</a>() sets the target distance between neighbouring notches in pixels. The default is 3.75 pixels.</p>
<p>Like the slider, the dial makes the <a href="qabstractslider.html">QAbstractSlider</a> functions <a href="qabstractslider.html#value-prop">setValue</a>(), <a href="qabstractslider-qt3.html#addLine">addLine</a>(), <a href="qabstractslider-qt3.html#subtractLine">subtractLine</a>(), <a href="qabstractslider-qt3.html#addPage">addPage</a>() and <a href="qabstractslider-qt3.html#subtractPage">subtractPage</a>() available as slots.</p>
<p>The dial's keyboard interface is fairly simple: The left/up and right/down arrow keys move by <a href="qabstractslider-qt3.html#lineStepx">lineStep</a>(), page up and page down by <a href="qabstractslider.html#pageStep-prop">pageStep</a>() and Home and End to <a href="qabstractslider-qt3.html#minValue">minValue</a>() and <a href="qabstractslider-qt3.html#maxValue">maxValue</a>().</p>
<table align="center" border="0" cellpadding="2" cellspacing="1">
<tr bgcolor="#F0F0F0" valign="top">
<td><img alt="Screenshot of a dial in the Plastique widget style" src="images/plastique-dial.png" /></td>
<td><img alt="Screenshot of a dial in the Windows XP widget style" src="images/windowsxp-dial.png" /></td>
<td><img alt="Screenshot of a dial in the Macintosh widget style" src="images/macintosh-dial.png" /></td>
</tr>
<tr bgcolor="#E0E0E0" valign="top">
<td colspan="3">Dials shown in various widget styles (from left to right): <a href="gallery-plastique.html">Plastique</a>, <a href="gallery-windowsxp.html">Windows XP</a>, <a href="gallery-macintosh.html">Macintosh</a>.</td>
</tr>
</table>
<br />
<br />
<p>See also <a href="qscrollbar.html">QScrollBar</a>, <a href="qspinbox.html">QSpinBox</a>, and <a href="guibooks.html#fowler">GUI Design Handbook: Slider</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDial" />QDial.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a dial.</p>
<p>The <i>parent</i> argument is sent to the <a href="qabstractslider.html">QAbstractSlider</a> constructor.</p>
<h3 class="fn"><a name="event" />bool QDial.event (<i>self</i>, <a href="qevent.html">QEvent</a> <i>e</i>)</h3><h3 class="fn"><a name="minimumSizeHint" /><a href="qsize.html">QSize</a> QDial.minimumSizeHint (<i>self</i>)</h3><h3 class="fn"><a name="mouseMoveEvent" />QDial.mouseMoveEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a> <i>me</i>)</h3><h3 class="fn"><a name="mousePressEvent" />QDial.mousePressEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a> <i>me</i>)</h3><h3 class="fn"><a name="mouseReleaseEvent" />QDial.mouseReleaseEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a> <i>me</i>)</h3><h3 class="fn"><a name="notchesVisible" />bool QDial.notchesVisible (<i>self</i>)</h3><h3 class="fn"><a name="notchSize" />int QDial.notchSize (<i>self</i>)</h3><h3 class="fn"><a name="notchTarget" />float QDial.notchTarget (<i>self</i>)</h3><h3 class="fn"><a name="paintEvent" />QDial.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a> <i>pe</i>)</h3><h3 class="fn"><a name="resizeEvent" />QDial.resizeEvent (<i>self</i>, <a href="qresizeevent.html">QResizeEvent</a> <i>re</i>)</h3><h3 class="fn"><a name="setNotchesVisible" />QDial.setNotchesVisible (<i>self</i>, bool <i>visible</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setNotchesVisible(bool)</tt>.</p><h3 class="fn"><a name="setNotchTarget" />QDial.setNotchTarget (<i>self</i>, float <i>target</i>)</h3><h3 class="fn"><a name="setWrapping" />QDial.setWrapping (<i>self</i>, bool <i>on</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setWrapping(bool)</tt>.</p><h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QDial.sizeHint (<i>self</i>)</h3><h3 class="fn"><a name="sliderChange" />QDial.sliderChange (<i>self</i>, <a href="qabstractslider.html#SliderChange-enum">QAbstractSlider.SliderChange</a> <i>change</i>)</h3><h3 class="fn"><a name="wrapping" />bool QDial.wrapping (<i>self</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt 4.0.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.trolltech.com">Trolltech AS</a> 2006</td><td align="right" width="25%">Qt 4.1.4</td></tr></table></div></address></body></html>
|