Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QString QString::arg ( qlonglong  a,
int  fieldWidth = 0,
int  base = 10,
const QChar fillChar = QLatin1Char(' ') 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The base argument specifies the base to use when converting the integer a into a string. The base must be between 2 and 36, with 8 giving octal, 10 decimal, and 16 hexadecimal numbers.

Definition at line 6071 of file qstring.cpp.

References QLocale::d(), data(), number(), and toLocal8Bit().

Referenced by QFileDialog::accept(), arg(), Q3UrlOperator::copy(), QFile::copy(), QWindowsVistaStyle::drawControl(), Q3IconDrag::encodedData(), Q3FileDialog::listBoxSelectionChanged(), QGraphicsSvgItem::paint(), QSqlRelationalTableModel::selectStatement(), Q3UrlOperator::startOperation(), QDate::toString(), QHttpRequestHeader::toString(), QTime::toString(), Q3HttpRequestHeader::toString(), QHttpResponseHeader::toString(), Q3Url::toString(), Q3HttpResponseHeader::toString(), QCoreApplication::translate(), and vsprintf().

    ArgEscapeData d = findArgEscapes(*this);

    if (d.occurrences == 0) {
        qWarning("QString::arg: Argument missing: %s, %lld", toLocal8Bit().data(), a);
        return *this;

    QString arg;
    if (d.occurrences > d.locale_occurrences)
        arg = number(a, base);

    QString locale_arg;
    if (d.locale_occurrences > 0) {
        QLocale locale;
        locale_arg = locale.d()->longLongToString(a, -1, base, -1, QLocalePrivate::ThousandsGroup);

    return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg, fillChar);

Generated by  Doxygen 1.6.0   Back to index