Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ac91357d6caede925de099a02fced14e > files > 4610

qt4-doc-4.2.1-1.el5_7.1.x86_64.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /tmp/qt-4.2.1-harald-1161357942206/qt-x11-opensource-src-4.2.1/src/gui/widgets/qslider.cpp -->
<head>
  <title>Qt 4.2: QSlider Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<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="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></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>
<pre> #include &lt;QSlider&gt;</pre><p>Inherits <a href="qabstractslider.html">QAbstractSlider</a>.</p>
<ul>
<li><a href="qslider-members.html">List of all members, including inherited members</a></li>
<li><a href="qslider-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-types"></a>
<h3>Public Types</h3>
<ul>
<li><div class="fn"/>enum <b><a href="qslider.html#TickPosition-enum">TickPosition</a></b> { NoTicks, TicksBothSides, TicksAbove, TicksBelow, TicksLeft, TicksRight }</li>
</ul>
<a name="properties"></a>
<h3>Properties</h3>
<ul>
<li><div class="fn"/><b><a href="qslider.html#tickInterval-prop">tickInterval</a></b> : int</li>
<li><div class="fn"/><b><a href="qslider.html#tickPosition-prop">tickPosition</a></b> : TickPosition</li>
</ul>
<ul>
<li><div class="fn"/>11 properties inherited from <a href="qabstractslider.html#properties">QAbstractSlider</a></li>
<li><div class="fn"/>55 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qslider.html#QSlider">QSlider</a></b> ( QWidget * <i>parent</i> = 0 )</li>
<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>
<li><div class="fn"/><b><a href="qslider.html#dtor.QSlider">~QSlider</a></b> ()</li>
<li><div class="fn"/>void <b><a href="qslider.html#tickInterval-prop">setTickInterval</a></b> ( int <i>ti</i> )</li>
<li><div class="fn"/>void <b><a href="qslider.html#tickPosition-prop">setTickPosition</a></b> ( TickPosition <i>position</i> )</li>
<li><div class="fn"/>int <b><a href="qslider.html#tickInterval-prop">tickInterval</a></b> () const</li>
<li><div class="fn"/>TickPosition <b><a href="qslider.html#tickPosition-prop">tickPosition</a></b> () const</li>
</ul>
<ul>
<li><div class="fn"/>22 public functions inherited from <a href="qabstractslider.html#public-functions">QAbstractSlider</a></li>
<li><div class="fn"/>195 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div class="fn"/>12 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>2 public slots inherited from <a href="qabstractslider.html#public-slots">QAbstractSlider</a></li>
<li><div class="fn"/>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li><div class="fn"/>6 signals inherited from <a href="qabstractslider.html#signals">QAbstractSlider</a></li>
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"/>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"/>3 protected functions inherited from <a href="qabstractslider.html#protected-functions">QAbstractSlider</a></li>
<li><div class="fn"/>38 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"/>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li><div class="fn"/>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<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" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th>Signal</th><th>Description</th></tr></thead>
<tr valign="top" class="odd"><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 valign="top" class="even"><td><a href="qabstractslider.html#sliderPressed">sliderPressed</a>()</td><td>Emitted when the user starts to drag the slider.</td></tr>
<tr valign="top" class="odd"><td><a href="qabstractslider.html#sliderMoved">sliderMoved</a>()</td><td>Emitted when the user drags the slider.</td></tr>
<tr valign="top" class="even"><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 width="100%" align="center" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><td><img src="images/macintosh-slider.png" alt="Screenshot of a Macintosh slider" /></td><td>A slider shown in the <a href="gallery-macintosh.html">Macintosh widget style</a>.</td></tr>
<tr valign="top" class="even"><td><img src="images/windows-slider.png" alt="Screenshot of a Windows XP slider" /></td><td>A slider shown in the <a href="gallery-windowsxp.html">Windows XP widget style</a>.</td></tr>
<tr valign="top" class="odd"><td><img src="images/plastique-slider.png" alt="Screenshot of a Plastique slider" /></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>Member Type Documentation</h2>
<h3 class="fn"><a name="TickPosition-enum"></a>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" 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>Property Documentation</h2>
<h3 class="fn"><a name="tickInterval-prop"></a>tickInterval : int</h3>
<p>This property holds the interval between tickmarks.</p>
<p>This is a value interval, not a pixel interval. If it is 0, the slider will choose between <a href="qabstractslider-qt3.html#lineStepx">lineStep</a>() and <a href="qabstractslider.html#pageStep-prop">pageStep</a>().</p>
<p>The default value is 0.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>int tickInterval () const</b></li>
<li><div class="fn"/><b>void setTickInterval ( int <i>ti</i> )</b></li>
</ul>
<p>See also <a href="qslider.html#tickPosition-prop">tickPosition</a>, <a href="qabstractslider-qt3.html#lineStepx">lineStep</a>(), and <a href="qabstractslider.html#pageStep-prop">pageStep</a>().</p>
<h3 class="fn"><a name="tickPosition-prop"></a>tickPosition : <a href="qslider.html#TickPosition-enum">TickPosition</a></h3>
<p>This property holds the tickmark position for this slider.</p>
<p>The valid values are described by the <a href="qslider.html#TickPosition-enum">QSlider::TickPosition</a> enum.</p>
<p>The default value is <a href="qslider.html#TickPosition-enum">QSlider::NoTicks</a>.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>TickPosition tickPosition () const</b></li>
<li><div class="fn"/><b>void setTickPosition ( TickPosition <i>position</i> )</b></li>
</ul>
<p>See also <a href="qslider.html#tickInterval-prop">tickInterval</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QSlider"></a>QSlider::QSlider ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a vertical slider with the given <i>parent</i>.</p>
<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>
<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="dtor.QSlider"></a>QSlider::~QSlider ()</h3>
<p>Destroys this slider.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QSlider-3"></a>QSlider::QSlider ( <a href="qwidget.html">QWidget</a> * <i>parent</i>, const char * <i>name</i> )</h3>
<p>Use <a href="qslider.html#QSlider">QSlider</a>() and <a href="qobject.html#objectName-prop">QObject::setObjectName</a>() instead.</p>
<p>For example, if you have code like</p>
<pre><font color="#404040"> QSlider *mySlider = new QSlider(parent, name);</font></pre>
<p>you can rewrite it as</p>
<pre> QSlider *mySlider = new QSlider(parent);
 mySlider-&gt;setObjectName(name);</pre>
<h3 class="fn"><a name="QSlider-4"></a>QSlider::QSlider ( <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i>, const char * <i>name</i> )</h3>
<p>Use <a href="qslider.html#QSlider">QSlider</a>() and <a href="qobject.html#objectName-prop">QObject::setObjectName</a>() instead.</p>
<p>For example, if you have code like</p>
<pre><font color="#404040"> QSlider *mySlider = new QSlider(orientation, parent, name);</font></pre>
<p>you can rewrite it as</p>
<pre> QSlider *mySlider = new QSlider(orientation, parent);
 mySlider-&gt;setObjectName(name);</pre>
<h3 class="fn"><a name="QSlider-5"></a>QSlider::QSlider ( int <i>minValue</i>, int <i>maxValue</i>, int <i>pageStep</i>, int <i>value</i>, <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
<p>Use <a href="qslider.html#QSlider">QSlider</a>(), <a href="qobject.html#objectName-prop">QObject::setObjectName</a>() and the functionality inherited from <a href="qabstractslider.html">QAbstractSlider</a> instead.</p>
<p>For example, if you have code like</p>
<pre><font color="#404040"> QSlider *mySlider = new QSlider(minValue, maxValue, pageStep,
                                 value, orientation, parent, name);</font></pre>
<p>you can rewrite it as</p>
<pre> QSlider *mySlider = new QSlider(orientation, parent);
 mySlider-&gt;setObjectName(name);
 mySlider-&gt;setMinimum(minValue);
 mySlider-&gt;setMaximum(maxValue);
 mySlider-&gt;setPageStep(pageStep);
 mySlider-&gt;setValue(value);</pre>
<h3 class="fn"><a name="addStep"></a>void QSlider::addStep ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Use <a href="qabstractslider.html#value-prop">setValue</a>() instead.</p>
<h3 class="fn"><a name="setTickmarks"></a>void QSlider::setTickmarks ( <a href="qslider.html#TickPosition-enum">TickPosition</a> <i>position</i> )</h3>
<p>Use <a href="qslider.html#tickPosition-prop">setTickPosition</a>() instead.</p>
<p>See also <a href="qslider-qt3.html#tickmarks">tickmarks</a>().</p>
<h3 class="fn"><a name="subtractStep"></a>void QSlider::subtractStep ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Use <a href="qabstractslider.html#value-prop">setValue</a>() instead.</p>
<h3 class="fn"><a name="tickmarks"></a><a href="qslider.html#TickPosition-enum">TickPosition</a> QSlider::tickmarks () const</h3>
<p>Use <a href="qslider.html#tickPosition-prop">tickPosition</a>() instead.</p>
<p>See also <a href="qslider-qt3.html#setTickmarks">setTickmarks</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2006 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.2.1</div></td>
</tr></table></div></address></body>
</html>