~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qslider.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/widgets/qslider.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: QSlider Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QSlider Class Reference</h1>
 
21
<p>The QSlider widget provides a vertical or horizontal slider. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QSlider&gt;</pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
 
23
<p>Inherits <a href="qabstractslider.html">QAbstractSlider</a>.</p>
 
24
<ul>
 
25
<li><a href="qslider-members.html">List of all members, including inherited members</a></li>
 
26
<li><a href="qslider-qt3.html">Qt 3 support members</a></li>
 
27
</ul>
 
28
<a name="public-types"></a>
 
29
<h3>Public Types</h3>
 
30
<ul>
 
31
<li><div class="fn"/>enum <b><a href="qslider.html#TickPosition-enum">TickPosition</a></b> { NoTicks, TicksBothSides, TicksAbove, TicksBelow, TicksLeft, TicksRight }</li>
 
32
</ul>
 
33
<a name="properties"></a>
 
34
<h3>Properties</h3>
 
35
<ul>
 
36
<li><div class="fn"/><b><a href="qslider.html#tickInterval-prop">tickInterval</a></b> : int</li>
 
37
<li><div class="fn"/><b><a href="qslider.html#tickPosition-prop">tickPosition</a></b> : TickPosition</li>
 
38
</ul>
 
39
<ul>
 
40
<li><div class="fn"/>11 properties inherited from <a href="qabstractslider.html#properties">QAbstractSlider</a></li>
 
41
<li><div class="fn"/>52 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
 
42
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
43
</ul>
 
44
<a name="public-functions"></a>
 
45
<h3>Public Functions</h3>
 
46
<ul>
 
47
<li><div class="fn"/><b><a href="qslider.html#QSlider">QSlider</a></b> ( QWidget * <i>parent</i> = 0 )</li>
 
48
<li><div class="fn"/><b><a href="qslider.html#QSlider-2">QSlider</a></b> ( Qt::Orientation <i>orientation</i>, QWidget * <i>parent</i> = 0 )</li>
 
49
<li><div class="fn"/><b><a href="qslider.html#dtor.QSlider">~QSlider</a></b> ()</li>
 
50
<li><div class="fn"/>void <b><a href="qslider.html#tickInterval-prop">setTickInterval</a></b> ( int <i>ti</i> )</li>
 
51
<li><div class="fn"/>void <b><a href="qslider.html#tickPosition-prop">setTickPosition</a></b> ( TickPosition <i>position</i> )</li>
 
52
<li><div class="fn"/>int <b><a href="qslider.html#tickInterval-prop">tickInterval</a></b> () const</li>
 
53
<li><div class="fn"/>TickPosition <b><a href="qslider.html#tickPosition-prop">tickPosition</a></b> () const</li>
 
54
</ul>
 
55
<ul>
 
56
<li><div class="fn"/>22 public functions inherited from <a href="qabstractslider.html#public-functions">QAbstractSlider</a></li>
 
57
<li><div class="fn"/>183 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
 
58
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
59
<li><div class="fn"/>10 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
60
</ul>
 
61
<h3>Additional Inherited Members</h3>
 
62
<ul>
 
63
<li><div class="fn"/>2 public slots inherited from <a href="qabstractslider.html#public-slots">QAbstractSlider</a></li>
 
64
<li><div class="fn"/>17 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
 
65
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
66
<li><div class="fn"/>6 signals inherited from <a href="qabstractslider.html#signals">QAbstractSlider</a></li>
 
67
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
 
68
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
 
69
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
 
70
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
71
<li><div class="fn"/>3 protected functions inherited from <a href="qabstractslider.html#protected-functions">QAbstractSlider</a></li>
 
72
<li><div class="fn"/>39 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
 
73
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
74
</ul>
 
75
<a name="details"></a>
 
76
<hr />
 
77
<h2>Detailed Description</h2>
 
78
<p>The QSlider widget provides a vertical or horizontal slider.</p>
 
79
<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>
 
80
<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>
 
81
<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.</p>
 
82
<p>QSlider inherits a comprehensive set of signals:</p>
 
83
<table align="center" cellpadding="2" cellspacing="1" border="0">
 
84
<tr valign="top" bgcolor="#a2c511"><th>Signal</th><th>Emitted when</th></tr>
 
85
<tr valign="top" bgcolor="#f0f0f0"><td><a href="qabstractslider.html#valueChanged">valueChanged</a>()</td><td>the slider's value has changed. The tracking() determines whether this signal is emitted during user interaction.</td></tr>
 
86
<tr valign="top" bgcolor="#e0e0e0"><td><a href="qabstractslider.html#sliderPressed">sliderPressed</a>()</td><td>the user starts to drag the slider.</td></tr>
 
87
<tr valign="top" bgcolor="#f0f0f0"><td><a href="qabstractslider.html#sliderMoved">sliderMoved</a>()</td><td>the user drags the slider.</td></tr>
 
88
<tr valign="top" bgcolor="#e0e0e0"><td><a href="qabstractslider.html#sliderReleased">sliderReleased</a>()</td><td>the user releases the slider.</td></tr>
 
89
</table>
 
90
<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>
 
91
<p>A slider accepts focus on Tab and provides both a mouse wheel and a keyboard interface. The keyboard interface is the following:</p>
 
92
<ul>
 
93
<li>Left/Right move a horizontal slider by one single step.</li>
 
94
<li>Up/Down move a vertical slider by one single step.</li>
 
95
<li>PageUp moves up one page.</li>
 
96
<li>PageDown moves down one page.</li>
 
97
<li>Home moves to the start (mininum).</li>
 
98
<li>End moves to the end (maximum).</li>
 
99
</ul>
 
100
<center><img src="images/macintosh-slider.png" alt="Screenshot in Macintosh style" /></center><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>
 
101
<hr />
 
102
<h2>Member Type Documentation</h2>
 
103
<h3 class="fn"><a name="TickPosition-enum"></a>enum QSlider::TickPosition</h3>
 
104
<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>
 
105
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
106
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
107
<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>
 
108
<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>
 
109
<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>
 
110
<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>
 
111
<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>
 
112
<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>
 
113
</table>
 
114
<hr />
 
115
<h2>Property Documentation</h2>
 
116
<h3 class="fn"><a name="tickInterval-prop"></a>tickInterval : int</h3>
 
117
<p>This property holds the interval between tickmarks.</p>
 
118
<p>This is a value interval, not a pixel interval. If it is 0, the slider will choose between <a href="qabstractslider-qt3.html#lineStep">lineStep</a>() and <a href="qabstractslider.html#pageStep-prop">pageStep</a>(). The initial value of tickInterval is 0.</p>
 
119
<p>Access functions:</p>
 
120
<ul>
 
121
<li><div class="fn"/><b>int tickInterval () const</b></li>
 
122
<li><div class="fn"/><b>void setTickInterval ( int <i>ti</i> )</b></li>
 
123
</ul>
 
124
<p>See also <a href="qslider.html#tickPosition-prop">tickPosition</a>, <a href="qabstractslider-qt3.html#lineStep">lineStep</a>(), and <a href="qabstractslider.html#pageStep-prop">pageStep</a>().</p>
 
125
<h3 class="fn"><a name="tickPosition-prop"></a>tickPosition : <a href="qslider.html#TickPosition-enum">TickPosition</a></h3>
 
126
<p>This property holds the tickmark position for this slider.</p>
 
127
<p>The valid values are in <a href="qslider.html#TickPosition-enum">QSlider::TickPosition</a>. The default is <tt>NoTicks</tt>.</p>
 
128
<p>Access functions:</p>
 
129
<ul>
 
130
<li><div class="fn"/><b>TickPosition tickPosition () const</b></li>
 
131
<li><div class="fn"/><b>void setTickPosition ( TickPosition <i>position</i> )</b></li>
 
132
</ul>
 
133
<p>See also <a href="qslider.html#tickInterval-prop">tickInterval</a>.</p>
 
134
<hr />
 
135
<h2>Member Function Documentation</h2>
 
136
<h3 class="fn"><a name="QSlider"></a>QSlider::QSlider ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
 
137
<p>Constructs a vertical slider.</p>
 
138
<p>The <i>parent</i> argument is sent to the <a href="qabstractslider.html">QAbstractSlider</a> constructor.</p>
 
139
<h3 class="fn"><a name="QSlider-2"></a>QSlider::QSlider ( <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
 
140
<p>Constructs a slider.</p>
 
141
<p>The <i>orientation</i> must be <a href="qt.html#Orientation-enum">Qt::Vertical</a> or <a href="qt.html#Orientation-enum">Qt::Horizontal</a>.</p>
 
142
<p>The <i>parent</i> argument is sent on to the <a href="qabstractslider.html">QAbstractSlider</a> constructor.</p>
 
143
<h3 class="fn"><a name="dtor.QSlider"></a>QSlider::~QSlider ()</h3>
 
144
<p>Destructor.</p>
 
145
<p /><address><hr /><div align="center">
 
146
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
147
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
148
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
149
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
150
</tr></table></div></address></body>
 
151
</html>