File: qslider.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (67 lines) | stat: -rw-r--r-- 12,980 bytes parent folder | download
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?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>QSlider 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">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QSlider Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QSlider widget provides a vertical or horizontal slider. <a href="#details">More...</a></p>
<p>Inherits <a href="qabstractslider.html">QAbstractSlider</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qslider.html#TickPosition-enum">TickPosition</a></b> { NoTicks, TicksAbove, TicksLeft, TicksBelow, TicksRight, TicksBothSides }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qslider.html#QSlider">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qslider.html#QSlider-2">__init__</a></b> (<i>self</i>, Qt.Orientation, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />bool <b><a href="qslider.html#event">event</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qslider.html#initStyleOption">initStyleOption</a></b> (<i>self</i>, QStyleOptionSlider)</li><li><div class="fn" />QSize <b><a href="qslider.html#minimumSizeHint">minimumSizeHint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qslider.html#mouseMoveEvent">mouseMoveEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" /><b><a href="qslider.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" /><b><a href="qslider.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" /><b><a href="qslider.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent)</li><li><div class="fn" /><b><a href="qslider.html#setTickInterval">setTickInterval</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qslider.html#setTickPosition">setTickPosition</a></b> (<i>self</i>, TickPosition)</li><li><div class="fn" />QSize <b><a href="qslider.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qslider.html#tickInterval">tickInterval</a></b> (<i>self</i>)</li><li><div class="fn" />TickPosition <b><a href="qslider.html#tickPosition">tickPosition</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QSlider widget provides a vertical or horizontal slider.</p>
<p>The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along a horizontal or vertical groove and translates the handle's position into an integer value within the legal range.</p>
<p>QSlider has very few of its own functions; most of the functionality is in <a href="qabstractslider.html">QAbstractSlider</a>. The most useful functions are <a href="qabstractslider.html#value-prop">setValue</a>() to set the slider directly to some value; <a href="qabstractslider.html#triggerAction">triggerAction</a>() to simulate the effects of clicking (useful for shortcut keys); <a href="qabstractslider.html#singleStep-prop">setSingleStep</a>(), <a href="qabstractslider.html#pageStep-prop">setPageStep</a>() to set the steps; and <a href="qabstractslider.html#minimum-prop">setMinimum</a>() and <a href="qabstractslider.html#maximum-prop">setMaximum</a>() to define the range of the scroll bar.</p>
<p>QSlider provides methods for controlling tickmarks. You can use <a href="qslider.html#tickPosition-prop">setTickPosition</a>() to indicate where you want the tickmarks to be, <a href="qslider.html#tickInterval-prop">setTickInterval</a>() to indicate how many of them you want. the currently set tick position and interval can be queried using the <a href="qslider.html#tickPosition-prop">tickPosition</a>() and <a href="qslider.html#tickInterval-prop">tickInterval</a>() functions, respectively.</p>
<p>QSlider inherits a comprehensive set of signals:</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic">
<thead><tr class="qt-style" valign="top"><th>Signal</th><th>Description</th></tr></thead>
<tr class="odd" valign="top"><td><a href="qabstractslider.html#valueChanged">valueChanged</a>()</td><td>Emitted when the slider's value has changed. The tracking() determines whether this signal is emitted during user interaction.</td></tr>
<tr class="even" valign="top"><td><a href="qabstractslider.html#sliderPressed">sliderPressed</a>()</td><td>Emitted when the user starts to drag the slider.</td></tr>
<tr class="odd" valign="top"><td><a href="qabstractslider.html#sliderMoved">sliderMoved</a>()</td><td>Emitted when the user drags the slider.</td></tr>
<tr class="even" valign="top"><td><a href="qabstractslider.html#sliderReleased">sliderReleased</a>()</td><td>Emitted when the user releases the slider.</td></tr>
</table></p>
<p>QSlider only provides integer ranges. Note that although QSlider handles very large numbers, it becomes difficult for users to use a slider accurately for very large ranges.</p>
<p>A slider accepts focus on Tab and provides both a mouse wheel and a keyboard interface. The keyboard interface is the following:</p>
<ul>
<li>Left/Right move a horizontal slider by one single step.</li>
<li>Up/Down move a vertical slider by one single step.</li>
<li>PageUp moves up one page.</li>
<li>PageDown moves down one page.</li>
<li>Home moves to the start (mininum).</li>
<li>End moves to the end (maximum).</li>
</ul>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic" width="100%">
<tr class="odd" valign="top"><td><img alt="Screenshot of a Macintosh slider" src="images/macintosh-slider.png" /></td><td>A slider shown in the <a href="gallery-macintosh.html">Macintosh widget style</a>.</td></tr>
<tr class="even" valign="top"><td><img alt="Screenshot of a Windows XP slider" src="images/windows-slider.png" /></td><td>A slider shown in the <a href="gallery-windowsxp.html">Windows XP widget style</a>.</td></tr>
<tr class="odd" valign="top"><td><img alt="Screenshot of a Plastique slider" src="images/plastique-slider.png" /></td><td>A slider shown in the <a href="gallery-plastique.html">Plastique widget style</a>.</td></tr>
</table></p>
<p>See also <a href="qscrollbar.html">QScrollBar</a>, <a href="qspinbox.html">QSpinBox</a>, <a href="qdial.html">QDial</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Slider</a>, and <a href="widgets-sliders.html">Sliders Example</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="TickPosition-enum" />QSlider.TickPosition</h3><p>This enum specifies where the tick marks are to be drawn relative to the slider's groove and the handle the user moves.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QSlider.NoTicks</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Do not draw any tick marks.</td></tr>
<tr><td valign="top"><tt>QSlider.TicksBothSides</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Draw tick marks on both sides of the groove.</td></tr>
<tr><td valign="top"><tt>QSlider.TicksAbove</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Draw tick marks above the (horizontal) slider</td></tr>
<tr><td valign="top"><tt>QSlider.TicksBelow</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Draw tick marks below the (horizontal) slider</td></tr>
<tr><td valign="top"><tt>QSlider.TicksLeft</tt></td><td align="center" valign="top"><tt>TicksAbove</tt></td><td valign="top">Draw tick marks to the left of the (vertical) slider</td></tr>
<tr><td valign="top"><tt>QSlider.TicksRight</tt></td><td align="center" valign="top"><tt>TicksBelow</tt></td><td valign="top">Draw tick marks to the right of the (vertical) slider</td></tr>
</table></p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QSlider" />QSlider.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;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 vertical slider with the given <i>parent</i>.</p>
<h3 class="fn"><a name="QSlider-2" />QSlider.__init__ (<i>self</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;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 slider with the given <i>parent</i>. The <i>orientation</i> parameter determines whether the slider is horizontal or vertical; the valid values are <a href="qt.html#Orientation-enum">Qt.Vertical</a> and <a href="qt.html#Orientation-enum">Qt.Horizontal</a>.</p>
<a name="//apple_ref/cpp/instm/QSlider/~QSlider" />
<h3 class="fn"><a name="event" />bool QSlider.event (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>
<a name="//apple_ref/cpp/instm/QSlider/initStyleOption" />
<h3 class="fn"><a name="initStyleOption" />QSlider.initStyleOption (<i>self</i>, <a href="qstyleoptionslider.html">QStyleOptionSlider</a>)</h3><p>Initialize <i>option</i> with the values from this <a href="qslider.html">QSlider</a>. This method is useful for subclasses when they need a <a href="qstyleoptionslider.html">QStyleOptionSlider</a>, but don't want to fill in all the information themselves.</p>
<p>See also <a href="qstyleoption.html#initFrom">QStyleOption.initFrom</a>().</p>
<a name="//apple_ref/cpp/instm/QSlider/minimumSizeHint" />
<h3 class="fn"><a name="minimumSizeHint" /><a href="qsize.html">QSize</a> QSlider.minimumSizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget.minimumSizeHint</a>().</p>
<a name="//apple_ref/cpp/instm/QSlider/mouseMoveEvent" />
<h3 class="fn"><a name="mouseMoveEvent" />QSlider.mouseMoveEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget.mouseMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QSlider/mousePressEvent" />
<h3 class="fn"><a name="mousePressEvent" />QSlider.mousePressEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget.mousePressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QSlider/mouseReleaseEvent" />
<h3 class="fn"><a name="mouseReleaseEvent" />QSlider.mouseReleaseEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget.mouseReleaseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QSlider/paintEvent" />
<h3 class="fn"><a name="paintEvent" />QSlider.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QSlider/sizeHint" />
<h3 class="fn"><a name="setTickInterval" />QSlider.setTickInterval (<i>self</i>, int)</h3><h3 class="fn"><a name="setTickPosition" />QSlider.setTickPosition (<i>self</i>, <a href="qslider.html#TickPosition-enum">TickPosition</a>)</h3><h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QSlider.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p>
<p /><h3 class="fn"><a name="tickInterval" />int QSlider.tickInterval (<i>self</i>)</h3><h3 class="fn"><a name="tickPosition" /><a href="qslider.html#TickPosition-enum">TickPosition</a> QSlider.tickPosition (<i>self</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>