Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 3457

qt4-doc-4.6.3-0.2mdv2010.2.i586.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">
<!-- q3progressbar.cpp -->
<head>
  <title>Qt 4.6: Q3ProgressBar Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//Q3ProgressBar"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" 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="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">Q3ProgressBar Class Reference<br /><span class="small-subtitle">[<a href="qt3support.html">Qt3Support</a> module]</span>
</h1>
<p>The Q3ProgressBar widget provides a horizontal progress bar. <a href="#details">More...</a></p>
<pre> #include &lt;Q3ProgressBar&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html#qprogressbar">Porting to Qt 4</a> for more information.</p>
<p>Inherits <a href="qframe.html">QFrame</a>.</p>
<ul>
<li><a href="q3progressbar-members.html">List of all members, including inherited members</a></li>
<li><a href="q3progressbar-obsolete.html">Obsolete members</a></li>
</ul>
<hr />
<a name="properties"></a>
<h2>Properties</h2>
<p><table class="propsummary" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"><b><a href="q3progressbar.html#centerIndicator-prop">centerIndicator</a></b> : bool</div></li>
<li><div class="fn"><b><a href="q3progressbar.html#percentageVisible-prop">percentageVisible</a></b> : bool</div></li>
<li><div class="fn"><b><a href="q3progressbar.html#progress-prop">progress</a></b> : int</div></li>
</ul></td><td valign="top"><ul>
<li><div class="fn"><b><a href="q3progressbar.html#progressString-prop">progressString</a></b> : const QString</div></li>
<li><div class="fn"><b><a href="q3progressbar.html#totalSteps-prop">totalSteps</a></b> : int</div></li>
</ul>
</td></tr>
</table></p>
<ul>
<li><div bar="2" class="fn"></div>6 properties inherited from <a href="qframe.html#properties">QFrame</a></li>
<li><div bar="2" class="fn"></div>58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#Q3ProgressBar">Q3ProgressBar</a></b> ( QWidget * <i>parent</i> = 0, Qt::WindowFlags <i>f</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#Q3ProgressBar-4">Q3ProgressBar</a></b> ( int <i>totalSteps</i>, QWidget * <i>parent</i> = 0, Qt::WindowFlags <i>f</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#centerIndicator-prop">centerIndicator</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#margin">margin</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#percentageVisible-prop">percentageVisible</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#progress-prop">progress</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const QString &amp; </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#progressString-prop">progressString</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#centerIndicator-prop">setCenterIndicator</a></b> ( bool <i>on</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#setMargin">setMargin</a></b> ( int <i>margin</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#percentageVisible-prop">setPercentageVisible</a></b> ( bool )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#totalSteps-prop">totalSteps</a></b> () const</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual QSize </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#minimumSizeHint">minimumSizeHint</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#setVisible">setVisible</a></b> ( bool <i>visible</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QSize </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#sizeHint">sizeHint</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>14 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
<li><div bar="2" class="fn"></div>217 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<hr />
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#reset">reset</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#progress-prop">setProgress</a></b> ( int <i>progress</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#progress-prop">setProgress</a></b> ( int <i>progress</i>, int <i>totalSteps</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#totalSteps-prop">setTotalSteps</a></b> ( int <i>totalSteps</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<hr />
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#setIndicator">setIndicator</a></b> ( QString &amp; <i>indicator</i>, int <i>progress</i>, int <i>totalSteps</i> )</td></tr>
</table>
<hr />
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#changeEvent">changeEvent</a></b> ( QEvent * <i>ev</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="q3progressbar.html#paintEvent">paintEvent</a></b> ( QPaintEvent * )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>3 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li><div bar="2" class="fn"></div>37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li><div class="fn"></div>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>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 Q3ProgressBar widget provides a horizontal 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 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="q3progressbar.html#totalSteps-prop">setTotalSteps</a>(). The current number of steps is set with <a href="q3progressbar.html#progress-prop">setProgress</a>(). The progress bar can be rewound to the beginning with <a href="q3progressbar.html#reset">reset</a>().</p>
<p>If the total is given as 0 the progress 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" class="obsolete">QHttp</a> to download items when they are unable to determine the size of the item being downloaded.</p>
<p><img src="images/qprogbar-m.png" alt="Screenshot in Motif style" /> <img src="images/qprogbar-w.png" alt="Screenshot in Windows style" /></p>
<p>See also <a href="qprogressdialog.html">QProgressDialog</a> and <a href="qprogressdialog.html">QProgressDialog</a>.</p>
<hr />
<h2>Property Documentation</h2>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/centerIndicator"></a>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/setCenterIndicator"></a>
<h3 class="fn"><a name="centerIndicator-prop"></a>centerIndicator : bool</h3>
<p>This property holds whether the indicator string should be centered.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>centerIndicator</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setCenterIndicator</b> ( bool <i>on</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/percentageVisible"></a>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/setPercentageVisible"></a>
<h3 class="fn"><a name="percentageVisible-prop"></a>percentageVisible : bool</h3>
<p>This property holds whether the current progress value is displayed.</p>
<p>The default is true.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>percentageVisible</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setPercentageVisible</b> ( bool )</td></tr>
</table>
<p>See also <a href="q3progressbar.html#centerIndicator-prop">centerIndicator</a>.</p>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/progress"></a>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/setProgress"></a>
<h3 class="fn"><a name="progress-prop"></a>progress : int</h3>
<p>This property holds the current amount of progress.</p>
<p>This property is -1 if progress counting has not started.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b>progress</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setProgress</b> ( int <i>progress</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setProgress</b> ( int <i>progress</i>, int <i>totalSteps</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/progressString"></a>
<h3 class="fn"><a name="progressString-prop"></a>progressString : const <a href="qstring.html">QString</a></h3>
<p>This property holds the amount of progress as a string.</p>
<p>This property is an empty string if progress counting has not started.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">const QString &amp; </td><td class="memItemRight" valign="bottom"><b>progressString</b> () const</td></tr>
</table>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/totalSteps"></a>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/setTotalSteps"></a>
<h3 class="fn"><a name="totalSteps-prop"></a>totalSteps : int</h3>
<p>This property holds the total number of steps.</p>
<p>If totalSteps is 0, the progress bar will display a busy indicator.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b>totalSteps</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setTotalSteps</b> ( int <i>totalSteps</i> )</td></tr>
</table>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/Q3ProgressBar"></a>
<h3 class="fn"><a name="Q3ProgressBar"></a>Q3ProgressBar::Q3ProgressBar ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, <a href="qt.html#WindowType-enum">Qt::WindowFlags</a> <i>f</i> = 0 )</h3>
<p>Constructs a progress bar.</p>
<p>The total number of steps is set to 100 by default.</p>
<p>The <i>parent</i>, and widget flags, <i>f</i>, are passed on to the <a href="qframe.html#QFrame">QFrame::QFrame</a>() constructor.</p>
<p>See also <a href="q3progressbar.html#totalSteps-prop">setTotalSteps</a>().</p>
<h3 class="fn"><a name="Q3ProgressBar-4"></a>Q3ProgressBar::Q3ProgressBar ( int <i>totalSteps</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, <a href="qt.html#WindowType-enum">Qt::WindowFlags</a> <i>f</i> = 0 )</h3>
<p>Constructs a progress bar.</p>
<p>The <i>totalSteps</i> 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 setProgress(0); call setProgress(50) after examining the last file.</p>
<p>The <i>parent</i>, and widget flags, <i>f</i>, are passed to the <a href="qframe.html#QFrame">QFrame::QFrame</a>() constructor.</p>
<p>See also <a href="q3progressbar.html#totalSteps-prop">setTotalSteps</a>() and <a href="q3progressbar.html#progress-prop">setProgress</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/changeEvent"></a>
<h3 class="fn"><a name="changeEvent"></a>void Q3ProgressBar::changeEvent ( <a href="qevent.html">QEvent</a> * <i>ev</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/margin"></a>
<h3 class="fn"><a name="margin"></a>int Q3ProgressBar::margin () const</h3>
<p>Returns the width of the margin around the contents of the widget.</p>
<p>This function uses <a href="qwidget.html#getContentsMargins">QWidget::getContentsMargins</a>() to get the margin.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="q3progressbar.html#setMargin">setMargin</a>() and <a href="qwidget.html#getContentsMargins">QWidget::getContentsMargins</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/minimumSizeHint"></a>
<h3 class="fn"><a name="minimumSizeHint"></a><a href="qsize.html">QSize</a> Q3ProgressBar::minimumSizeHint () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget::minimumSizeHint</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/paintEvent"></a>
<h3 class="fn"><a name="paintEvent"></a>void Q3ProgressBar::paintEvent ( <a href="qpaintevent.html">QPaintEvent</a> * )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/reset"></a>
<h3 class="fn"><a name="reset"></a>void Q3ProgressBar::reset ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Reset the progress bar. The progress bar &quot;rewinds&quot; and shows no progress.</p>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/setIndicator"></a>
<h3 class="fn"><a name="setIndicator"></a>bool Q3ProgressBar::setIndicator ( <a href="qstring.html">QString</a> &amp; <i>indicator</i>, int <i>progress</i>, int <i>totalSteps</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This method is called to generate the text displayed in the center (or in some styles, to the left) of the progress bar.</p>
<p>The <i>progress</i> may be negative, indicating that the progress bar is in the &quot;reset&quot; state before any progress is set.</p>
<p>The default implementation is the percentage of completion or blank in the reset state. The percentage is calculated based on the <i>progress</i> and <i>totalSteps</i>. You can set the <i>indicator</i> text if you wish.</p>
<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.</p>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/setMargin"></a>
<h3 class="fn"><a name="setMargin"></a>void Q3ProgressBar::setMargin ( int <i>margin</i> )</h3>
<p>Sets the width of the margin around the contents of the widget to <i>margin</i>.</p>
<p>This function uses <a href="qwidget.html#setContentsMargins">QWidget::setContentsMargins</a>() to set the margin.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="q3progressbar.html#margin">margin</a>() and <a href="qwidget.html#setContentsMargins">QWidget::setContentsMargins</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/setVisible"></a>
<h3 class="fn"><a name="setVisible"></a>void Q3ProgressBar::setVisible ( bool <i>visible</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#visible-prop">QWidget::setVisible</a>().</p>
<a name="//apple_ref/cpp/instm/Q3ProgressBar/sizeHint"></a>
<h3 class="fn"><a name="sizeHint"></a><a href="qsize.html">QSize</a> Q3ProgressBar::sizeHint () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>