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
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QProgressBar Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QProgressBar Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QProgressBar widget provides a horizontal or vertical progress bar. <a href="#details">More...</a></p>
<p>Inherits <a href="qwidget.html">QWidget</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qprogressbar.html#Direction-enum">Direction</a></b> { TopToBottom, BottomToTop }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qprogressbar.html#QProgressBar">__init__</a></b> (<i>self</i>, QWidget <i>parent</i> = None)</li><li><div class="fn" />Qt.Alignment <b><a href="qprogressbar.html#alignment">alignment</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qprogressbar.html#event">event</a></b> (<i>self</i>, QEvent <i>e</i>)</li><li><div class="fn" />bool <b><a href="qprogressbar.html#invertedAppearance">invertedAppearance</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qprogressbar.html#isTextVisible">isTextVisible</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qprogressbar.html#maximum">maximum</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qprogressbar.html#minimum">minimum</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qprogressbar.html#minimumSizeHint">minimumSizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.Orientation <b><a href="qprogressbar.html#orientation">orientation</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qprogressbar.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent)</li><li><div class="fn" /><b><a href="qprogressbar.html#reset">reset</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qprogressbar.html#setAlignment">setAlignment</a></b> (<i>self</i>, Qt.Alignment <i>alignment</i>)</li><li><div class="fn" /><b><a href="qprogressbar.html#setInvertedAppearance">setInvertedAppearance</a></b> (<i>self</i>, bool <i>invert</i>)</li><li><div class="fn" /><b><a href="qprogressbar.html#setMaximum">setMaximum</a></b> (<i>self</i>, int <i>maximum</i>)</li><li><div class="fn" /><b><a href="qprogressbar.html#setMinimum">setMinimum</a></b> (<i>self</i>, int <i>minimum</i>)</li><li><div class="fn" /><b><a href="qprogressbar.html#setOrientation">setOrientation</a></b> (<i>self</i>, Qt.Orientation)</li><li><div class="fn" /><b><a href="qprogressbar.html#setRange">setRange</a></b> (<i>self</i>, int <i>minimum</i>, int <i>maximum</i>)</li><li><div class="fn" /><b><a href="qprogressbar.html#setTextDirection">setTextDirection</a></b> (<i>self</i>, Direction <i>textDirection</i>)</li><li><div class="fn" /><b><a href="qprogressbar.html#setTextVisible">setTextVisible</a></b> (<i>self</i>, bool <i>visible</i>)</li><li><div class="fn" /><b><a href="qprogressbar.html#setValue">setValue</a></b> (<i>self</i>, int <i>value</i>)</li><li><div class="fn" />QSize <b><a href="qprogressbar.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qprogressbar.html#text">text</a></b> (<i>self</i>)</li><li><div class="fn" />Direction <b><a href="qprogressbar.html#textDirection">textDirection</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qprogressbar.html#value">value</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qprogressbar.html#valueChanged">valueChanged</a></b> (int)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QProgressBar widget provides a horizontal or vertical progress bar.</p>
<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>
<p>The progress bar uses the concept of <i>steps</i>. You set it up by specifying the minumum and maximum possible step values, and it will display the percentage of steps that have been completed when you later give it the current step value. The percentage is calculated by dividing the progress (<a href="qprogressbar.html#value-prop">value</a>() - <a href="qprogressbar.html#minimum-prop">minimum</a>()) divided by <a href="qprogressbar.html#maximum-prop">maximum</a>() - <a href="qprogressbar.html#minimum-prop">minimum</a>().</p>
<p>You can specify the minimum and maximum number of steps with <a href="qprogressbar.html#minimum-prop">setMinimum</a>() and setMaximum. The current number of steps is set with <a href="qprogressbar.html#value-prop">setValue</a>(). The progress bar can be rewound to the beginning with <a href="qprogressbar.html#reset">reset</a>().</p>
<p>If minimum and maximum both are set to 0, the bar shows a busy indicator instead of a percentage of steps. This is useful, for example, when using <a href="qftp.html">QFtp</a> or <a href="qhttp.html">QHttp</a> to download items when they are unable to determine the size of the item being downloaded.</p>
<table align="center" border="0" cellpadding="2" cellspacing="1">
<tr bgcolor="#F0F0F0" valign="top">
<td><img alt="Screenshot of a Macintosh style progress bar" src="images/macintosh-progressbar.png" /></td>
<td>A progress bar shown in the Macintosh widget style.</td>
</tr>
<tr bgcolor="#E0E0E0" valign="top">
<td><img alt="Screenshot of a Windows XP style progress bar" src="images/windowsxp-progressbar.png" /></td>
<td>A progress bar shown in the Windows XP widget style.</td>
</tr>
<tr bgcolor="#F0F0F0" valign="top">
<td><img alt="Screenshot of a Plastique style progress bar" src="images/plastique-progressbar.png" /></td>
<td>A progress bar shown in the Plastique widget style.</td>
</tr>
</table>
<br />
<br />
<p>See also <a href="qprogressdialog.html">QProgressDialog</a> and <a href="guibooks.html#fowler">GUI Design Handbook: Progress Indicator</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Direction-enum" />QProgressBar.Direction</h3><p>Specifies the reading direction of the <a href="qprogressbar.html#text-prop">text</a> for vertical progress bars.</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>QProgressBar.TopToBottom</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
<td valign="top">The text is rotated 90 degrees clockwise.</td>
</tr>
<tr>
<td valign="top"><tt>QProgressBar.BottomToTop</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
<td valign="top">The text is rotated 90 degrees counter-clockwise.</td>
</tr>
</table>
<br />
<br />
<p>This enum was introduced in Qt 4.1.</p>
<p>See also <a href="qprogressbar.html#textDirection-prop">textDirection</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QProgressBar" />QProgressBar.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a progress bar with the given <i>parent</i>.</p>
<p>By default, the minimum step value is set to 0, and the maximum to 100.</p>
<p>See also <a href="qprogressbar.html#setRange">setRange</a>().</p>
<h3 class="fn"><a name="alignment" /><a href="qt-alignment.html">Qt.Alignment</a> QProgressBar.alignment (<i>self</i>)</h3><h3 class="fn"><a name="event" />bool QProgressBar.event (<i>self</i>, <a href="qevent.html">QEvent</a> <i>e</i>)</h3><h3 class="fn"><a name="invertedAppearance" />bool QProgressBar.invertedAppearance (<i>self</i>)</h3><h3 class="fn"><a name="isTextVisible" />bool QProgressBar.isTextVisible (<i>self</i>)</h3><h3 class="fn"><a name="maximum" />int QProgressBar.maximum (<i>self</i>)</h3><h3 class="fn"><a name="minimum" />int QProgressBar.minimum (<i>self</i>)</h3><h3 class="fn"><a name="minimumSizeHint" /><a href="qsize.html">QSize</a> QProgressBar.minimumSizeHint (<i>self</i>)</h3><h3 class="fn"><a name="orientation" /><a href="qt.html#Orientation-enum">Qt.Orientation</a> QProgressBar.orientation (<i>self</i>)</h3><h3 class="fn"><a name="paintEvent" />QProgressBar.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>)</h3><h3 class="fn"><a name="reset" />QProgressBar.reset (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void reset()</tt>.</p><p>Reset the progress bar. The progress bar "rewinds" and shows no progress.</p>
<h3 class="fn"><a name="setAlignment" />QProgressBar.setAlignment (<i>self</i>, <a href="qt-alignment.html">Qt.Alignment</a> <i>alignment</i>)</h3><h3 class="fn"><a name="setInvertedAppearance" />QProgressBar.setInvertedAppearance (<i>self</i>, bool <i>invert</i>)</h3><h3 class="fn"><a name="setMaximum" />QProgressBar.setMaximum (<i>self</i>, int <i>maximum</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setMaximum(int)</tt>.</p><h3 class="fn"><a name="setMinimum" />QProgressBar.setMinimum (<i>self</i>, int <i>minimum</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setMinimum(int)</tt>.</p><h3 class="fn"><a name="setOrientation" />QProgressBar.setOrientation (<i>self</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setOrientation(Qt::Orientation)</tt>.</p><h3 class="fn"><a name="setRange" />QProgressBar.setRange (<i>self</i>, int <i>minimum</i>, int <i>maximum</i>)</h3><p>Sets the progressbar's minimum and maximum values to <i>minimum</i> and <i>maximum</i> respectively.</p>
<p>If <i>maximum</i> is smaller than <i>minimum</i>, <i>minimum</i> becomes the only legal value.</p>
<p>If the current value falls outside the new range, the progressbar is reset with <a href="qprogressbar.html#reset">reset</a>().</p>
<p>See also <a href="qprogressbar.html#minimum-prop">minimum</a> and <a href="qprogressbar.html#maximum-prop">maximum</a>.</p>
<h3 class="fn"><a name="setTextDirection" />QProgressBar.setTextDirection (<i>self</i>, <a href="qprogressbar.html#Direction-enum">Direction</a> <i>textDirection</i>)</h3><h3 class="fn"><a name="setTextVisible" />QProgressBar.setTextVisible (<i>self</i>, bool <i>visible</i>)</h3><h3 class="fn"><a name="setValue" />QProgressBar.setValue (<i>self</i>, int <i>value</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setValue(int)</tt>.</p><h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QProgressBar.sizeHint (<i>self</i>)</h3><h3 class="fn"><a name="text" /><a href="qstring.html">QString</a> QProgressBar.text (<i>self</i>)</h3><h3 class="fn"><a name="textDirection" /><a href="qprogressbar.html#Direction-enum">Direction</a> QProgressBar.textDirection (<i>self</i>)</h3><h3 class="fn"><a name="value" />int QProgressBar.value (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="valueChanged" />void valueChanged (int)</h3><p>This signal is emitted when the value shown in the progress bar changes. <i>value</i> is the new value shown by the progress bar.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt 4.0.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.trolltech.com">Trolltech AS</a> 2006</td><td align="right" width="25%">Qt 4.1.4</td></tr></table></div></address></body></html>
|