qslider.html

来自「QT 下载资料仅供参考」· HTML 代码 · 共 358 行 · 第 1/2 页

HTML
358
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/widgets/qslider.cpp:56 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QSlider Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QSlider Class Reference</h1><p>The QSlider widget provides a vertical or horizontal slider.<a href="#details">More...</a><p><tt>#include &lt;<a href="qslider-h.html">qslider.h</a>&gt;</tt><p>Inherits <a href="qwidget.html">QWidget</a> and <a href="qrangecontrol.html">QRangeControl</a>.<p><a href="qslider-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn>enum <a href="#TickSetting-enum"><b>TickSetting</b></a> { NoMarks = 0, Above = 1, Left = Above, Below = 2, Right = Below, Both = 3 }</div></li><li><div class=fn><a href="#QSlider"><b>QSlider</b></a> ( QWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li><li><div class=fn><a href="#QSlider-2"><b>QSlider</b></a> ( Orientation&nbsp;orientation, QWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li><li><div class=fn><a href="#QSlider-3"><b>QSlider</b></a> ( int&nbsp;minValue, int&nbsp;maxValue, int&nbsp;pageStep, int&nbsp;value, Orientation&nbsp;orientation, QWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li><li><div class=fn>virtual void <a href="#setOrientation"><b>setOrientation</b></a> ( Orientation )</div></li><li><div class=fn>Orientation <a href="#orientation"><b>orientation</b></a> () const</div></li><li><div class=fn>virtual void <a href="#setTracking"><b>setTracking</b></a> ( bool&nbsp;enable )</div></li><li><div class=fn>bool <a href="#tracking"><b>tracking</b></a> () const</div></li><li><div class=fn>virtual void <a href="#setPalette"><b>setPalette</b></a> ( const&nbsp;QPalette&nbsp;&amp;&nbsp;p )</div></li><li><div class=fn>int <a href="#sliderStart"><b>sliderStart</b></a> () const</div></li><li><div class=fn>QRect <a href="#sliderRect"><b>sliderRect</b></a> () const</div></li><li><div class=fn>virtual void <a href="#setTickmarks"><b>setTickmarks</b></a> ( TickSetting )</div></li><li><div class=fn>TickSetting <a href="#tickmarks"><b>tickmarks</b></a> () const</div></li><li><div class=fn>virtual void <a href="#setTickInterval"><b>setTickInterval</b></a> ( int )</div></li><li><div class=fn>int <a href="#tickInterval"><b>tickInterval</b></a> () const</div></li><li><div class=fn>int <a href="#minValue"><b>minValue</b></a> () const</div></li><li><div class=fn>int <a href="#maxValue"><b>maxValue</b></a> () const</div></li><li><div class=fn>void <a href="#setMinValue"><b>setMinValue</b></a> ( int )</div></li><li><div class=fn>void <a href="#setMaxValue"><b>setMaxValue</b></a> ( int )</div></li><li><div class=fn>int <a href="#lineStep"><b>lineStep</b></a> () const</div></li><li><div class=fn>int <a href="#pageStep"><b>pageStep</b></a> () const</div></li><li><div class=fn>void <a href="#setLineStep"><b>setLineStep</b></a> ( int )</div></li><li><div class=fn>void <a href="#setPageStep"><b>setPageStep</b></a> ( int )</div></li><li><div class=fn>int <a href="#value"><b>value</b></a> () const</div></li></ul><h2>Public Slots</h2><ul><li><div class=fn>virtual void <a href="#setValue"><b>setValue</b></a> ( int )</div></li><li><div class=fn>void <a href="#addStep"><b>addStep</b></a> ()</div></li><li><div class=fn>void <a href="#subtractStep"><b>subtractStep</b></a> ()</div></li></ul><h2>Signals</h2><ul><li><div class=fn>void <a href="#valueChanged"><b>valueChanged</b></a> ( int&nbsp;value )</div></li><li><div class=fn>void <a href="#sliderPressed"><b>sliderPressed</b></a> ()</div></li><li><div class=fn>void <a href="#sliderMoved"><b>sliderMoved</b></a> ( int&nbsp;value )</div></li><li><div class=fn>void <a href="#sliderReleased"><b>sliderReleased</b></a> ()</div></li></ul><h2>Important Inherited Members</h2><ul><li><div class=fn>void <a href="#setRange"><b>setRange</b></a> ( int&nbsp;minValue, int&nbsp;maxValue )</div></li></ul><h2>Properties</h2><ul><li><div class=fn>int <a href="#lineStep-prop"><b>lineStep</b></a>&nbsp;- the current line step</div></li><li><div class=fn>int <a href="#maxValue-prop"><b>maxValue</b></a>&nbsp;- the current maximum value of the slider</div></li><li><div class=fn>int <a href="#minValue-prop"><b>minValue</b></a>&nbsp;- the current minimum value of the slider</div></li><li><div class=fn>Orientation <a href="#orientation-prop"><b>orientation</b></a>&nbsp;- the orientation of the slider</div></li><li><div class=fn>int <a href="#pageStep-prop"><b>pageStep</b></a>&nbsp;- the current page step</div></li><li><div class=fn>int <a href="#tickInterval-prop"><b>tickInterval</b></a>&nbsp;- the interval between tickmarks</div></li><li><div class=fn>TickSetting <a href="#tickmarks-prop"><b>tickmarks</b></a>&nbsp;- the tickmark settings for this slider</div></li><li><div class=fn>bool <a href="#tracking-prop"><b>tracking</b></a>&nbsp;- whether slider tracking is enabled</div></li><li><div class=fn>int <a href="#value-prop"><b>value</b></a>&nbsp;- the current slider value</div></li></ul><h2>Protected Members</h2><ul><li><div class=fn>virtual void <a href="#valueChange"><b>valueChange</b></a> ()</div></li><li><div class=fn>virtual void <a href="#rangeChange"><b>rangeChange</b></a> ()</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QSlider widget provides a vertical or horizontal slider.<p> The slider is the classic widget for controlling a bounded value.It lets the user move a slider along a horizontal or verticalgroove and translates the slider's position into an integer valuewithin the legal range.<p> QSlider inherits <a href="qrangecontrol.html">QRangeControl</a>, which provides the "integer" side ofthe slider.  <a href="qrangecontrol.html#setRange">setRange</a>() and <a href="#value">value</a>() are likely to be used bypractically all slider users; see the <a href="qrangecontrol.html">QRangeControl</a> documentationfor information about the many other functions that class provides.<p> The main functions offered by the slider itself are tickmark andorientation control; you can use <a href="#setTickmarks">setTickmarks</a>() to indicate whereyou want the tickmarks to be, <a href="#setTickInterval">setTickInterval</a>() to indicate how manyof them you want and <a href="#setOrientation">setOrientation</a>() to indicate whether theslider is to be horizontal or vertical.<p> A slider has a default <a href="qwidget.html#focusPolicy">focusPolicy</a>() of <tt>WeakWheelFocus</tt>, i.e. itaccepts focus on Tab and uses the mouse wheel and asuitable keyboard interface.<p> <img src=qslider-m.png> <img src=qslider-w.png><p> <p> <p>See also <a href="qscrollbar.html">QScrollBar</a>, <a href="qspinbox.html">QSpinBox</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Slider</a> and <a href="basic.html">Basic Widgets</a>.<hr><h2>Member Type Documentation</h2><h3 class=fn><a name="TickSetting-enum"></a>QSlider::TickSetting</h3> <p> This enum specifies where the tickmarks are to be drawn relativeto the slider's groove and the handle the user moves.  The possiblevalues are:<ul><li><tt>QSlider::NoMarks</tt> - do not draw any tickmarks.<li><tt>QSlider::Both</tt> - draw tickmarks on both sides of the groove.<li><tt>QSlider::Above</tt> - draw tickmarks above the (horizontal) slider<li><tt>QSlider::Below</tt> - draw tickmarks below the (horizontal) slider<li><tt>QSlider::Left</tt> - draw tickmarks to the left of the (vertical) slider<li><tt>QSlider::Right</tt> - draw tickmarks to the right of the (vertical) slider</ul><hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QSlider"></a>QSlider::QSlider ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</h3>Constructs a vertical slider.<p> The <em>parent</em> and <em>name</em> arguments are sent to the <a href="qwidget.html">QWidget</a> constructor.<h3 class=fn><a name="QSlider-2"></a>QSlider::QSlider ( <a href="qt.html#Orientation-enum">Orientation</a>&nbsp;orientation, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</h3>Constructs a slider.<p> The <em>orientation</em> must be <a href="qt.html#Orientation-enum">Qt::Vertical</a> or <a href="qt.html#Orientation-enum">Qt::Horizontal</a>.<p> The <em>parent</em> and <em>name</em> arguments are sent to the <a href="qwidget.html">QWidget</a> constructor.<h3 class=fn><a name="QSlider-3"></a>QSlider::QSlider ( int&nbsp;minValue, int&nbsp;maxValue, int&nbsp;pageStep, int&nbsp;value, <a href="qt.html#Orientation-enum">Orientation</a>&nbsp;orientation, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</h3>  Constructs a slider whose value can never be smaller than <em>minValue</em> or greater than <em>maxValue</em>, whose page step size is<em>pageStep</em> and whose value is initially <em>value</em> (which isguaranteed to be in range using <a href="qrangecontrol.html#bound">bound</a>()).<p> If <em>orientation</em> is Qt::Vertical the slider is vertical and if it isQt::Horizontal the slider is horizontal.<p> The <em>parent</em> and <em>name</em> arguments are sent to the <a href="qwidget.html">QWidget</a> constructor.<h3 class=fn>void <a name="addStep"></a>QSlider::addStep ()<tt> [slot]</tt></h3>Moves the slider one <a href="#pageStep">pageStep</a>() up or right.<h3 class=fn>int <a name="lineStep"></a>QSlider::lineStep () const</h3><p>Returns the current line step.See the <a href="qslider.html#lineStep-prop">"lineStep"</a> property for details.<h3 class=fn>int <a name="maxValue"></a>QSlider::maxValue () const</h3><p>Returns the current maximum value of the slider.See the <a href="qslider.html#maxValue-prop">"maxValue"</a> property for details.<h3 class=fn>int <a name="minValue"></a>QSlider::minValue () const</h3><p>Returns the current minimum value of the slider.See the <a href="qslider.html#minValue-prop">"minValue"</a> property for details.<h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation"></a>QSlider::orientation () const</h3><p>Returns the orientation of the slider.See the <a href="qslider.html#orientation-prop">"orientation"</a> property for details.<h3 class=fn>int <a name="pageStep"></a>QSlider::pageStep () const</h3><p>Returns the current page step.See the <a href="qslider.html#pageStep-prop">"pageStep"</a> property for details.<h3 class=fn>void <a name="rangeChange"></a>QSlider::rangeChange ()<tt> [virtual protected]</tt></h3>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?