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

QString QString::toLower (  )  const

Returns a lowercase copy of the string.

        QString str = "TROlltECH";
        str = str.toLower();        // str == "trolltech"

See also:
toUpper()

Definition at line 4102 of file qstring.cpp.

References QChar::cell(), data(), size(), and QChar::unicode().

Referenced by Q3FileDialog::eventFilter(), Q3ListView::findItem(), Q3IconView::findItem(), Q3ListBox::findItem(), Q3IconView::findItemByName(), QDirModel::index(), QFont::insertSubstitution(), Q3ListView::keyPressEvent(), QAbstractItemModel::match(), QDir::operator==(), QHttpHeader::parseLine(), Q3StyleSheetItem::Q3StyleSheetItem(), QDir::relativeFilePath(), QFont::substitute(), QFont::substitutes(), and QAbstractFormBuilder::toBool().

{
    int l = d->size;
    if (l) {
        QChar *p = (QChar*)d->data;
        if (p) {
            while (l) {
                bool different;
                if (p->unicode() & 0xFF80)
                    different = (*p != ::lower(*p));
                else
                    different = ((uint)p->cell() - 'A' < 26);

                if (different) {
                    QString s(*this);
                    p = (QChar*)s.data() + (p - (QChar*)d->data);
                    while (l) {
                        *p = ::lower(*p);
                        l--;
                        p++;
                    }
                    return s;
                }
                l--;
                p++;
            }
        }
    }
    return *this;
}


Generated by  Doxygen 1.6.0   Back to index