Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1658

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/widgets/qprogressbar.cpp:49 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QProgressBar 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>QProgressBar Class Reference</h1>

<p>The QProgressBar widget provides a horizontal progress bar.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qprogressbar-h.html">qprogressbar.h</a>&gt;</tt>
<p>Inherits <a href="qframe.html">QFrame</a>.
<p><a href="qprogressbar-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn><a href="#QProgressBar"><b>QProgressBar</b></a> ( QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )</div></li>
<li><div class=fn><a href="#QProgressBar-2"><b>QProgressBar</b></a> ( int&nbsp;totalSteps, QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )</div></li>
<li><div class=fn>int <a href="#totalSteps"><b>totalSteps</b></a> () const</div></li>
<li><div class=fn>int <a href="#progress"><b>progress</b></a> () const</div></li>
<li><div class=fn>const QString &amp; <a href="#progressString"><b>progressString</b></a> () const</div></li>
<li><div class=fn>void <a href="#setCenterIndicator"><b>setCenterIndicator</b></a> ( bool&nbsp;on )</div></li>
<li><div class=fn>bool <a href="#centerIndicator"><b>centerIndicator</b></a> () const</div></li>
<li><div class=fn>void <a href="#setIndicatorFollowsStyle"><b>setIndicatorFollowsStyle</b></a> ( bool )</div></li>
<li><div class=fn>bool <a href="#indicatorFollowsStyle"><b>indicatorFollowsStyle</b></a> () const</div></li>
<li><div class=fn>bool <a href="#percentageVisible"><b>percentageVisible</b></a> () const</div></li>
<li><div class=fn>void <a href="#setPercentageVisible"><b>setPercentageVisible</b></a> ( bool )</div></li>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class=fn>void <a href="#reset"><b>reset</b></a> ()</div></li>
<li><div class=fn>virtual void <a href="#setTotalSteps"><b>setTotalSteps</b></a> ( int&nbsp;totalSteps )</div></li>
<li><div class=fn>virtual void <a href="#setProgress"><b>setProgress</b></a> ( int&nbsp;progress )</div></li>
</ul>
<h2>Properties</h2>
<ul>
<li><div class=fn>bool <a href="#centerIndicator-prop"><b>centerIndicator</b></a>&nbsp;- whether the indicator string should be centered</div></li>
<li><div class=fn>bool <a href="#indicatorFollowsStyle-prop"><b>indicatorFollowsStyle</b></a>&nbsp;- whether the display of the indicator string should follow the GUI style</div></li>
<li><div class=fn>bool <a href="#percentageVisible-prop"><b>percentageVisible</b></a>&nbsp;- whether the current progress value is displayed</div></li>
<li><div class=fn>int <a href="#progress-prop"><b>progress</b></a>&nbsp;- the current amount of progress</div></li>
<li><div class=fn>QString <a href="#progressString-prop"><b>progressString</b></a>&nbsp;- the current amount of progress as a string &nbsp;<em>(read only)</em></div></li>
<li><div class=fn>int <a href="#totalSteps-prop"><b>totalSteps</b></a>&nbsp;- the total number of steps</div></li>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class=fn>virtual bool <a href="#setIndicator"><b>setIndicator</b></a> ( QString&nbsp;&amp;&nbsp;indicator, int&nbsp;progress, int&nbsp;totalSteps )</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The QProgressBar widget provides a horizontal progress bar.


<p> A progress bar is used to give the user an indication of the
progress of an operation and to reassure them that the application
is still running.
<p> The progress bar uses the concept of <em>steps</em>; you give it the
total number of steps and the number of steps completed so far and
it will display the percentage of steps that have been completed.
You can specify the total number of steps in the constructor or
later with <a href="#setTotalSteps">setTotalSteps</a>(). The current number of steps is set
with <a href="#setProgress">setProgress</a>(). The progress bar can be rewound to the
beginning with <a href="#reset">reset</a>().
<p> <p>See also <a href="qprogressdialog.html">QProgressDialog</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Progress Indicator</a> and <a href="advanced.html">Advanced Widgets</a>.

<p> <img src=qprogbar-m.png> <img src=qprogbar-w.png>
<p> <p>See also <a href="qprogressdialog.html">QProgressDialog</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Progress Indicator</a> and <a href="advanced.html">Advanced Widgets</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QProgressBar"></a>QProgressBar::QProgressBar ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )
</h3>
Constructs a progress bar.
<p> The total number of steps is set to 100 by default.
<p> The <em>parent</em>, <em>name</em> and <a href="qt.html#WidgetFlags">widget flags</a>, <em>f</em>, are passed on to the
<a href="qframe.html#QFrame">QFrame::QFrame</a>() constructor.
<p> <p>See also <a href="#totalSteps-prop">totalSteps</a>.

<h3 class=fn><a name="QProgressBar-2"></a>QProgressBar::QProgressBar ( int&nbsp;totalSteps, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )
</h3>
Constructs a progress bar.
<p> The <em>totalSteps</em> is the total number of steps that need to be
completed for the operation which this progress bar represents.
For example, if the operation is to examine 50 files, this value
would be 50. Before examining the first file, call <a href="#setProgress">setProgress</a>(0);
call setProgress(50) after examining the last file .
<p> The <em>parent</em>, <em>name</em> and <a href="qt.html#WidgetFlags">widget flags</a>, <em>f</em>, are passed to the
<a href="qframe.html#QFrame">QFrame::QFrame</a>() constructor.
<p> <p>See also <a href="#totalSteps-prop">totalSteps</a> and <a href="#progress-prop">progress</a>.

<h3 class=fn>bool <a name="centerIndicator"></a>QProgressBar::centerIndicator () const
</h3><p>Returns TRUE if the indicator string should be centered; otherwise returns FALSE.
See the <a href="qprogressbar.html#centerIndicator-prop">"centerIndicator"</a> property for details.
<h3 class=fn>bool <a name="indicatorFollowsStyle"></a>QProgressBar::indicatorFollowsStyle () const
</h3><p>Returns TRUE if the display of the indicator string should follow the GUI style; otherwise returns FALSE.
See the <a href="qprogressbar.html#indicatorFollowsStyle-prop">"indicatorFollowsStyle"</a> property for details.
<h3 class=fn>bool <a name="percentageVisible"></a>QProgressBar::percentageVisible () const
</h3><p>Returns TRUE if the current progress value is displayed; otherwise returns FALSE.
See the <a href="qprogressbar.html#percentageVisible-prop">"percentageVisible"</a> property for details.
<h3 class=fn>int <a name="progress"></a>QProgressBar::progress () const
</h3><p>Returns the current amount of progress.
See the <a href="qprogressbar.html#progress-prop">"progress"</a> property for details.
<h3 class=fn>const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp; <a name="progressString"></a>QProgressBar::progressString () const
</h3><p>Returns the current amount of progress as a string.
See the <a href="qprogressbar.html#progressString-prop">"progressString"</a> property for details.
<h3 class=fn>void <a name="reset"></a>QProgressBar::reset ()<tt> [slot]</tt>
</h3>
Reset the progress bar.
The progress bar "rewinds" and shows no progress.

<p>Examples: <a href="fileiconview-example.html#x1602">fileiconview/mainwindow.cpp</a>, <a href="ftpclient-example.html#x1022">network/ftpclient/ftpmainwindow.cpp</a> and <a href="progressbar-example.html#x820">progressbar/progressbar.cpp</a>.
<h3 class=fn>void <a name="setCenterIndicator"></a>QProgressBar::setCenterIndicator ( bool&nbsp;on )
</h3><p>Sets whether the indicator string should be centered to <em>on</em>.
See the <a href="qprogressbar.html#centerIndicator-prop">"centerIndicator"</a> property for details.
<h3 class=fn>bool <a name="setIndicator"></a>QProgressBar::setIndicator ( <a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;indicator, int&nbsp;progress, int&nbsp;totalSteps )<tt> [virtual protected]</tt>
</h3>
This method is called to generate the text displayed in the center
(or in some styles, to the left) of the progress bar.
<p> The <em>progress</em> may be negative, indicating that the progress bar is
in the "reset" state before any progress is set.
<p> The default implementation is the percentage of completion or blank in the
reset state. The percentage is calculated based on the <em>progress</em>
and <em>totalSteps</em>. You can set the <em>indicator</em> text if you wish.
<p> To allow efficient repainting of the progress bar, this method
should return FALSE if the string is unchanged from the last call to
this function.

<h3 class=fn>void <a name="setIndicatorFollowsStyle"></a>QProgressBar::setIndicatorFollowsStyle ( bool )
</h3><p>Sets whether the display of the indicator string should follow the GUI style.
See the <a href="qprogressbar.html#indicatorFollowsStyle-prop">"indicatorFollowsStyle"</a> property for details.
<h3 class=fn>void <a name="setPercentageVisible"></a>QProgressBar::setPercentageVisible ( bool )
</h3><p>Sets whether the current progress value is displayed.
See the <a href="qprogressbar.html#percentageVisible-prop">"percentageVisible"</a> property for details.
<h3 class=fn>void <a name="setProgress"></a>QProgressBar::setProgress ( int&nbsp;progress )<tt> [virtual slot]</tt>
</h3><p>Sets the current amount of progress to <em>progress</em>.
See the <a href="qprogressbar.html#progress-prop">"progress"</a> property for details.
<h3 class=fn>void <a name="setTotalSteps"></a>QProgressBar::setTotalSteps ( int&nbsp;totalSteps )<tt> [virtual slot]</tt>
</h3><p>Sets the total number of steps to <em>totalSteps</em>.
See the <a href="qprogressbar.html#totalSteps-prop">"totalSteps"</a> property for details.
<h3 class=fn>int <a name="totalSteps"></a>QProgressBar::totalSteps () const
</h3><p>Returns the total number of steps.
See the <a href="qprogressbar.html#totalSteps-prop">"totalSteps"</a> property for details.
<hr><h2>Property Documentation</h2>
<h3 class=fn>bool <a name="centerIndicator-prop"></a>centerIndicator</h3>
<p>This property holds whether the indicator string should be centered.
<p>Changing this property sets <a href="#indicatorFollowsStyle-prop">QProgressBar::indicatorFollowsStyle</a>
to FALSE. The default is TRUE.

<p>Set this property's value with <a href="#setCenterIndicator">setCenterIndicator</a>() and get this property's value with <a href="#centerIndicator">centerIndicator</a>().
<h3 class=fn>bool <a name="indicatorFollowsStyle-prop"></a>indicatorFollowsStyle</h3>
<p>This property holds whether the display of the indicator string should follow the GUI style.
<p>The default is TRUE.
<p> <p>See also <a href="#centerIndicator-prop">centerIndicator</a>.

<p>Set this property's value with <a href="#setIndicatorFollowsStyle">setIndicatorFollowsStyle</a>() and get this property's value with <a href="#indicatorFollowsStyle">indicatorFollowsStyle</a>().
<h3 class=fn>bool <a name="percentageVisible-prop"></a>percentageVisible</h3>
<p>This property holds whether the current progress value is displayed.
<p>The default is TRUE.
<p> <p>See also <a href="#centerIndicator-prop">centerIndicator</a> and <a href="#indicatorFollowsStyle-prop">indicatorFollowsStyle</a>.

<p>Set this property's value with <a href="#setPercentageVisible">setPercentageVisible</a>() and get this property's value with <a href="#percentageVisible">percentageVisible</a>().
<h3 class=fn>int <a name="progress-prop"></a>progress</h3>
<p>This property holds the current amount of progress.
<p>This property is -1 if the progress counting has not started.

<p>Set this property's value with <a href="#setProgress">setProgress</a>() and get this property's value with <a href="#progress">progress</a>().
<h3 class=fn><a href="qstring.html">QString</a> <a name="progressString-prop"></a>progressString</h3>
<p>This property holds the current amount of progress as a string.
<p>This property is QString::null if the progress counting has not started.

<p>Get this property's value with <a href="#progressString">progressString</a>().
<h3 class=fn>int <a name="totalSteps-prop"></a>totalSteps</h3>
<p>This property holds the total number of steps.
<p>If totalSteps is null, the progress bar will display a busy indicator.
<p> <p>See also <a href="#totalSteps-prop">totalSteps</a>.

<p>Set this property's value with <a href="#setTotalSteps">setTotalSteps</a>() and get this property's value with <a href="#totalSteps">totalSteps</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2001
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>