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

template<typename T>
int QList< T >::removeAll ( const T &  value  )  [inline, inherited]

Removes all occurrences of value in the list and returns the number of entries removed.

Example: doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 9

This function requires the value type to have an implementation of operator==().

See also:
removeOne(), removeAt(), takeAt(), replace()

Definition at line 571 of file qlist.h.

References QList< T >::detach().

Referenced by QAbstractFormBuilder::create(), QAbstractFormBuilder::createDom(), Q3DockArea::moveDockWindow(), QHttpHeader::parse(), Q3DockArea::setAcceptDockWindow(), Q3ImageDrag::setImage(), QExtensionManager::unregisterExtensions(), ArchiveExtractor::~ArchiveExtractor(), QTextCodec::~QTextCodec(), and Uncompressor::~Uncompressor().

{
    detach();
    const T t = _t;
    int removedCount=0, i=0;
    Node *n;
    while (i < p.size())
        if ((n = reinterpret_cast<Node *>(p.at(i)))->t() == t) {
            node_destruct(n);
            p.remove(i);
            ++removedCount;
        } else {
            ++i;
        }
    return removedCount;
}


Generated by  Doxygen 1.6.0   Back to index