Changeset 561 for trunk/src/gui/widgets/qprogressbar.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/widgets/qprogressbar.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 173 173 174 174 \ingroup basicwidgets 175 \mainclass 175 176 176 177 177 A progress bar is used to give the user an indication of the … … 191 191 beginning with reset(). 192 192 193 If minimum and maximum both are set to 0, the bar shows a busy indicator 194 instead of a percentage of steps. This is useful, for example, when using 195 QFtp or QHttp to download items when they are unable to determine the 196 size of the item being downloaded. 193 If minimum and maximum both are set to 0, the bar shows a busy 194 indicator instead of a percentage of steps. This is useful, for 195 example, when using QFtp or QNetworkAccessManager to download 196 items when they are unable to determine the size of the item being 197 downloaded. 197 198 198 199 \table … … 205 206 \endtable 206 207 207 \sa Q TimeLine, QProgressDialog, {fowler}{GUI Design Handbook: Progress Indicator}208 \sa QProgressDialog, {fowler}{GUI Design Handbook: Progress Indicator} 208 209 */ 209 210 … … 350 351 \brief whether the current completed percentage should be displayed 351 352 353 354 352 355 \sa textDirection 353 356 */ … … 442 445 { 443 446 Q_D(const QProgressBar); 444 if ( d->maximum == 0|| d->value < d->minimum447 if ( || d->value < d->minimum 445 448 || (d->value == INT_MIN && d->minimum == INT_MIN)) 446 449 return QString(); 447 450 448 qint64 totalSteps = qint64(d->maximum) - qint64(d->minimum);451 qint64 totalSteps = qint64(d->maximum) - ; 449 452 450 453 QString result = d->format; 451 result.replace(QLatin1String("%m"), QString:: fromLatin1("%1").arg(totalSteps));452 result.replace(QLatin1String("%v"), QString:: fromLatin1("%1").arg(d->value));454 result.replace(QLatin1String("%m"), QString::(totalSteps)); 455 result.replace(QLatin1String("%v"), QString::(d->value)); 453 456 454 457 // If max and min are equal and we get this far, it means that the … … 456 459 // 100% here in order to avoid division by zero further down. 457 460 if (totalSteps == 0) { 458 result.replace(QLatin1String("%p"), QString:: fromLatin1("%1").arg(100));461 result.replace(QLatin1String("%p"), QString::(100)); 459 462 return result; 460 463 } 461 464 462 int progress = int(((qreal(d->value) - qreal(d->minimum)) * 100.0) / totalSteps);463 result.replace(QLatin1String("%p"), QString:: fromLatin1("%1").arg(progress));465 int progress = ; 466 result.replace(QLatin1String("%p"), QString::(progress)); 464 467 return result; 465 468 }
Note:
See TracChangeset
for help on using the changeset viewer.