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 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - 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: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">
<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>
<h1 align=center>QProgressBar Class Reference</h1><br clear="all">
<p>
The QProgressBar widget provides a horizontal progress bar.
<a href="#details">More...</a>
<p>
<code>#include <<a href="qprogressbar-h.html">qprogressbar.h</a>></code>
<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="#f3ac40"><b>QProgressBar</b></a>(QWidget*parent=0, constchar*name=0, WFlagsf=0)</div>
<li><div class="fn"><a href="#cfafe9"><b>QProgressBar</b></a>(inttotalSteps, QWidget*parent=0, constchar*name=0, WFlagsf=0)</div>
<li><div class="fn">int<a href="#ca5354"><b>totalSteps</b></a>()const</div>
<li><div class="fn">int<a href="#b58826"><b>progress</b></a>()const</div>
<li><div class="fn">void<a href="#1b3d8a"><b>setCenterIndicator</b></a>(boolon)</div>
<li><div class="fn">bool<a href="#35ef31"><b>centerIndicator</b></a>()const</div>
<li><div class="fn">void<a href="#1af7f3"><b>setIndicatorFollowsStyle</b></a>(bool)</div>
<li><div class="fn">bool<a href="#2c9a3f"><b>indicatorFollowsStyle</b></a>()const</div>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class="fn">void<a href="#e0ce26"><b>reset</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#d536e0"><b>setTotalSteps</b></a>(inttotalSteps)</div>
<li><div class="fn">virtualvoid<a href="#22694b"><b>setProgress</b></a>(intprogress)</div>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class="fn">virtualvoid<a href="#61de6d"><b>drawContentsMask</b></a>(QPainter*)</div>
<li><div class="fn">virtualbool<a href="#89d98e"><b>setIndicator</b></a>(QString&progress_str, intprogress, inttotalSteps)</div>
</ul>
<h2>Properties</h2>
<table border=1 cellpadding=3 cellspacing=0>
<tr><th>Type<th>Name<th>READ<th>WRITE<th>Options
<tr><td>int<td>totalSteps<td>totalSteps<td>setTotalSteps<td>
<tr><td>int<td>progress<td>progress<td>setProgress<td>
<tr><td>bool<td>centerIndicator<td>centerIndicator<td>setCenterIndicator<td>
<tr><td>bool<td>indicatorFollowsStyle<td>indicatorFollowsStyle<td>setIndicatorFollowsStyle<td>
</table>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QProgressBar widget provides a horizontal progress bar.
<p>
A progress bar is used to give the user an indication of progress
of an operation. To reassure them that the application has not crashed.
<p>QProgressBar only implements the basic progress display, while
<a href="qprogressdialog.html">QProgressDialog</a> provides a fuller encapsulation.
<p><img src=qprogbar-m.png> <img src=qprogbar-w.png>
<p>See also <a href="qprogressdialog.html">QProgressDialog</a> and <a href="guibooks.html#fowler">GUI Design Handbook: Progress Indicator</a>
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="f3ac40"></a>QProgressBar::QProgressBar(<a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0, WFlagsf=0)</h3>
<p>Constructs a progress bar.
<p>The total number of steps is set to 100 by default.
<p><em>parent, name</em> and <em>f</em> are sent to the <a href="qframe.html#2ba897">QFrame::QFrame</a>()
constructor.
<p>See also <a href="#d536e0">setTotalSteps</a>().
<h3 class="fn"><a name="cfafe9"></a>QProgressBar::QProgressBar(inttotalSteps, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0, WFlagsf=0)</h3>
<p>Constructs a progress bar.
<p><em>totalSteps</em> is the total number of steps in the operation of which
this progress bar shows the progress. For example, if the operation
is to examine 50 files, this value would be 50, then before
examining the first file, call <a href="#22694b">setProgress</a>(0), and after examining
the last file call setProgress(50).
<p><em>parent, name</em> and <em>f</em> are sent to the <a href="qframe.html#2ba897">QFrame::QFrame</a>()
constructor.
<p>See also <a href="#d536e0">setTotalSteps</a>() and <a href="#22694b">setProgress</a>().
<h3 class="fn">bool<a name="35ef31"></a>QProgressBar::centerIndicator()const</h3>
<p>Returns where the indicator string should be displayed if
<a href="#2c9a3f">indicatorFollowsStyle</a>() is TRUE.
<p>See also <a href="#1b3d8a">setCenterIndicator</a>(), <a href="#2c9a3f">indicatorFollowsStyle</a>(), <a href="#1af7f3">setIndicatorFollowsStyle</a>() and <a href="#89d98e">setIndicator</a>().
<h3 class="fn">void<a name="44664c"></a>QProgressBar::drawContents(<a href="qpainter.html">QPainter</a>*p) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qframe.html#1991fc">QFrame.</a>
<h3 class="fn">void<a name="61de6d"></a>QProgressBar::drawContentsMask(<a href="qpainter.html">QPainter</a>*p) <code>[virtualprotected]</code></h3>
<p>Draws the progressbar contents mask using the painter <em>p.</em>
Used only in transparent mode.
<p>See also <a href="qwidget.html#efa8f9">QWidget::setAutoMask</a>();.
<p>Reimplemented from <a href="qframe.html#ffb489">QFrame.</a>
<h3 class="fn">bool<a name="2c9a3f"></a>QProgressBar::indicatorFollowsStyle()const</h3>
<p>Returns whether the display of the indicator string should follow the
GUI style or not.
<p>See also <a href="#1af7f3">setIndicatorFollowsStyle</a>(), <a href="#1b3d8a">setCenterIndicator</a>(), <a href="#35ef31">centerIndicator</a>() and <a href="#89d98e">setIndicator</a>().
<h3 class="fn"><a href="qsize.html">QSize</a><a name="c7a8ed"></a>QProgressBar::minimumSizeHint()const <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#553e08">QWidget.</a>
<h3 class="fn">int<a name="b58826"></a>QProgressBar::progress()const</h3>
<p>Returns the current amount of progress, or -1 if the progress counting
has not started.
<p>See also <a href="#22694b">setProgress</a>().
<h3 class="fn">void<a name="e0ce26"></a>QProgressBar::reset() <code>[slot]</code></h3>
<p>Reset the progress bar.
The progress bar `rewinds'.
<h3 class="fn">void<a name="1b3d8a"></a>QProgressBar::setCenterIndicator(boolon)</h3>
<p>If set to TRUE (the default) the progress bar always shows the indicator
text at the center of the progress bar, regardless of the GUI style
currently set. If set to FALSE the progress bar always shows the
indicator text outside the progress bar, regardless of the GUI style
currently set.
<p>Calling this function always sets <a href="#2c9a3f">indicatorFollowsStyle</a>() to FALSE.
<p>See also <a href="#35ef31">centerIndicator</a>(), <a href="#2c9a3f">indicatorFollowsStyle</a>(), <a href="#1af7f3">setIndicatorFollowsStyle</a>() and <a href="#89d98e">setIndicator</a>().
<h3 class="fn">bool<a name="89d98e"></a>QProgressBar::setIndicator(<a href="qstring.html">QString</a>&indicator, intprogress, inttotalSteps) <code>[virtualprotected]</code></h3>
<p>This method is called to generate the text displayed in the center of
the progress bar.
<p>The progress may be negative, indicating that the bar is in the "reset" state
before any progress is set.
<p>The default implementation it is the percentage of completion or blank in the
reset state.
<p>This method should return FALSE if the string is unchanged since the
last call to the method, to allow efficient repainting of the
progress bar.
<h3 class="fn">void<a name="1af7f3"></a>QProgressBar::setIndicatorFollowsStyle(boolon)</h3>
<p>When set to TRUE (the default) the positioning of the indicator string
follows the GUI style. When set to FALSE the indicator position is decided
by the value of <a href="#2c9a3f">indicatorFollowsStyle</a>().
<p>See also <a href="#2c9a3f">indicatorFollowsStyle</a>(), <a href="#35ef31">centerIndicator</a>(), <a href="#1b3d8a">setCenterIndicator</a>() and <a href="#89d98e">setIndicator</a>().
<h3 class="fn">void<a name="22694b"></a>QProgressBar::setProgress(intprogress) <code>[virtualslot]</code></h3>
<p>Sets the current amount of progress made to <em>progress</em> units of the
total number of steps.
<p>See also <a href="#b58826">progress</a>() and <a href="#ca5354">totalSteps</a>().
<h3 class="fn">void<a name="d536e0"></a>QProgressBar::setTotalSteps(inttotalSteps) <code>[virtualslot]</code></h3>
<p>Sets the total number of steps to <em>totalSteps.</em>
<p>See also <a href="#ca5354">totalSteps</a>().
<h3 class="fn">void<a name="d35c1b"></a>QProgressBar::show() <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#200ee5">QWidget.</a>
<h3 class="fn"><a href="qsize.html">QSize</a><a name="507616"></a>QProgressBar::sizeHint()const <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#4511d1">QWidget.</a>
<h3 class="fn"><a href="qsizepolicy.html">QSizePolicy</a><a name="9165fc"></a>QProgressBar::sizePolicy()const <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#23726d">QWidget.</a>
<h3 class="fn">void<a name="af690e"></a>QProgressBar::styleChange(<a href="qstyle.html">QStyle</a>&old) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#5e2e23">QWidget.</a>
<h3 class="fn">int<a name="ca5354"></a>QProgressBar::totalSteps()const</h3>
<p>Returns the total number of steps.
<p>See also <a href="#d536e0">setTotalSteps</a>().
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright © 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 2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>
|