File: qslider.html

package info (click to toggle)
python-qt4 4.0.1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 18,632 kB
  • ctags: 2,639
  • sloc: python: 29,409; sh: 5,646; cpp: 3,168; xml: 149; makefile: 109
file content (108 lines) | stat: -rw-r--r-- 11,504 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?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&#160;<i>orientation</i>, 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&#160;<i>event</i>)</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&#160;<i>ev</i>)</li><li><div class="fn" /><b><a href="qslider.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>ev</i>)</li><li><div class="fn" /><b><a href="qslider.html#mouseReleaseEvent">mouseReleaseEvent</a></b> (<i>self</i>, QMouseEvent&#160;<i>ev</i>)</li><li><div class="fn" /><b><a href="qslider.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent&#160;<i>ev</i>)</li><li><div class="fn" /><b><a href="qslider.html#setTickInterval">setTickInterval</a></b> (<i>self</i>, int&#160;<i>ti</i>)</li><li><div class="fn" /><b><a href="qslider.html#setTickPosition">setTickPosition</a></b> (<i>self</i>, TickPosition&#160;<i>position</i>)</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>
<table align="center" border="0" cellpadding="2" cellspacing="1">
<tr bgcolor="#A2C511" valign="top">
<th>Signal</th>
<th>Description</th>
</tr>
<tr bgcolor="#F0F0F0" 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 bgcolor="#E0E0E0" valign="top">
<td><a href="qabstractslider.html#sliderPressed">sliderPressed</a>()</td>
<td>Emitted when the user starts to drag the slider.</td>
</tr>
<tr bgcolor="#F0F0F0" valign="top">
<td><a href="qabstractslider.html#sliderMoved">sliderMoved</a>()</td>
<td>Emitted when the user drags the slider.</td>
</tr>
<tr bgcolor="#E0E0E0" valign="top">
<td><a href="qabstractslider.html#sliderReleased">sliderReleased</a>()</td>
<td>Emitted when the user releases the slider.</td>
</tr>
</table>
<br />
<br />
<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>
<table align="center" border="0" cellpadding="2" cellspacing="1" width="100%">
<tr bgcolor="#F0F0F0" 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 bgcolor="#E0E0E0" 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 bgcolor="#F0F0F0" 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>
<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>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>
<table border="1" cellpadding="2" cellspacing="1" 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>
<br />
<br />
<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>&#160;<i>orientation</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 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>
<h3 class="fn"><a name="event" />bool QSlider.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>event</i>)</h3><h3 class="fn"><a name="minimumSizeHint" /><a href="qsize.html">QSize</a> QSlider.minimumSizeHint (<i>self</i>)</h3><h3 class="fn"><a name="mouseMoveEvent" />QSlider.mouseMoveEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>ev</i>)</h3><h3 class="fn"><a name="mousePressEvent" />QSlider.mousePressEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>ev</i>)</h3><h3 class="fn"><a name="mouseReleaseEvent" />QSlider.mouseReleaseEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>&#160;<i>ev</i>)</h3><h3 class="fn"><a name="paintEvent" />QSlider.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>&#160;<i>ev</i>)</h3><h3 class="fn"><a name="setTickInterval" />QSlider.setTickInterval (<i>self</i>, int&#160;<i>ti</i>)</h3><h3 class="fn"><a name="setTickPosition" />QSlider.setTickPosition (<i>self</i>, <a href="qslider.html#TickPosition-enum">TickPosition</a>&#160;<i>position</i>)</h3><h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QSlider.sizeHint (<i>self</i>)</h3><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 width="25%">PyQt&#160;4.0.1 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.trolltech.com">Trolltech&#160;AS</a> 2006</td><td align="right" width="25%">Qt&#160;4.1.4</td></tr></table></div></address></body></html>