Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/widgets/qprogressbar.cpp

    r2 r561  
    22**
    33** 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])
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    173173
    174174    \ingroup basicwidgets
    175     \mainclass
     175
    176176
    177177    A progress bar is used to give the user an indication of the
     
    191191    beginning with reset().
    192192
    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.
    197198
    198199    \table
     
    205206    \endtable
    206207
    207     \sa QTimeLine, QProgressDialog, {fowler}{GUI Design Handbook: Progress Indicator}
     208    \sa QProgressDialog, {fowler}{GUI Design Handbook: Progress Indicator}
    208209*/
    209210
     
    350351    \brief whether the current completed percentage should be displayed
    351352
     353
     354
    352355    \sa textDirection
    353356*/
     
    442445{
    443446    Q_D(const QProgressBar);
    444     if (d->maximum == 0 || d->value < d->minimum
     447    if ( || d->value < d->minimum
    445448            || (d->value == INT_MIN && d->minimum == INT_MIN))
    446449        return QString();
    447450
    448     qint64 totalSteps = qint64(d->maximum) - qint64(d->minimum);
     451    qint64 totalSteps = qint64(d->maximum) - ;
    449452
    450453    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));
    453456
    454457    // If max and min are equal and we get this far, it means that the
     
    456459    // 100% here in order to avoid division by zero further down.
    457460    if (totalSteps == 0) {
    458         result.replace(QLatin1String("%p"), QString::fromLatin1("%1").arg(100));
     461        result.replace(QLatin1String("%p"), QString::(100));
    459462        return result;
    460463    }
    461464
    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));
    464467    return result;
    465468}
Note: See TracChangeset for help on using the changeset viewer.