- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# QMultiMap< Key, T > Class Template Reference

Search for all occurrences

## Detailed Description

### template<class Key, class T>
class QMultiMap< Key, T >

Definition at line 969 of file qmap.h.

`#include <qmap.h>`

Inheritance diagram for QMultiMap< Key, T >:
[legend]

List of all members.

## Public Member Functions
| QMultiMap ()
| QMultiMap (const QMap< Key, T > &other)
QMap< Key, T >::iterator | replace (const Key &key, const T &value)
QMap< Key, T >::iterator | insert (const Key &key, const T &value)
QMultiMap & | operator+= (const QMultiMap &other)
QMultiMap | operator+ (const QMultiMap &other) const
bool | contains (const Key &key, const T &value) const
int | remove (const Key &key, const T &value)
int | count (const Key &key, const T &value) const
QMap< Key, T >::iterator | find (const Key &key, const T &value)
QMap< Key, T >::const_iterator | find (const Key &key, const T &value) const
QMap< Key, T >::const_iterator | constFind (const Key &key, const T &value) const

## Constructor & Destructor Documentation

QMultiMap | ( |  | ) | `[inline]`

Definition at line 972 of file qmap.h.

    {}

QMultiMap | ( | const QMap< Key, T > & | other | ) | `[inline]`

Definition at line 973 of file qmap.h.

    : QMap<Key, T>(other) {}

## Member Function Documentation

QMap<Key, T>::iterator replace | ( | const Key & | key,
|  | const T & | value
| ) |  | `[inline]`

Search for all occurrences

Definition at line 975 of file qmap.h.

        { return QMap<Key, T>::insert(key, value); }

QMap<Key, T>::iterator insert | ( | const Key & | key,
|  | const T & | value
| ) |  | `[inline]`

Search for all occurrences

Reimplemented from QMap< Key, T >.

Definition at line 977 of file qmap.h.

        { return QMap<Key, T>::insertMulti(key, value); }

QMultiMap& operator+= | ( | const QMultiMap< Key, T > & | other | ) | `[inline]`

Definition at line 980 of file qmap.h.

        { this->unite(other); return *this; }

QMultiMap operator+ | ( | const QMultiMap< Key, T > & | other | ) | const `[inline]`

Definition at line 982 of file qmap.h.

        { QMultiMap result = *this; result += other; return result; }

Q_INLINE_TEMPLATE bool contains | ( | const Key & | key,
|  | const T & | value
| ) |  | const

Search for all occurrences

Definition at line 1043 of file qmap.h.

    {
        return constFind(key, value) != QMap<Key, T>::constEnd();
    }

Q_INLINE_TEMPLATE int remove | ( | const Key & | key,
|  | const T & | value
| ) |  |

Search for all occurrences

Definition at line 1049 of file qmap.h.

    {
        int n = 0;
        typename QMap<Key, T>::iterator i(find(key));
        typename QMap<Key, T>::iterator end(QMap<Key, T>::end());
        while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
            if (i.value() == value) {
                i = this->erase(i);
                ++n;
            } else {
                ++i;
            }
        }
        return n;
    }

Q_INLINE_TEMPLATE int count | ( | const Key & | key,
|  | const T & | value
| ) |  | const

Search for all occurrences

Definition at line 1066 of file qmap.h.

    {
        int n = 0;
        typename QMap<Key, T>::const_iterator i(constFind(key));
        typename QMap<Key, T>::const_iterator end(QMap<Key, T>::constEnd());
        while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
            if (i.value() == value)
                ++n;
            ++i;
        }
        return n;
    }

QMap<Key, T>::iterator find | ( | const Key & | key,
|  | const T & | value
| ) |  | `[inline]`

Search for all occurrences

Definition at line 1015 of file qmap.h.

                                                                           {
            typename QMap<Key, T>::iterator i(find(key));
            typename QMap<Key, T>::iterator end(this->end());
            while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
                if (i.value() == value)
                    return i;
                ++i;
            }
            return end;
        }

QMap<Key, T>::const_iterator find | ( | const Key & | key,
|  | const T & | value
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 1025 of file qmap.h.

                                                                                       {
            typename QMap<Key, T>::const_iterator i(constFind(key));
            typename QMap<Key, T>::const_iterator end(QMap<Key, T>::constEnd());
            while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
                if (i.value() == value)
                    return i;
                ++i;
            }
            return end;
        }

QMap<Key, T>::const_iterator constFind | ( | const Key & | key,
|  | const T & | value
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 1035 of file qmap.h.

            { return find(key, value); }

The documentation for this class was generated from the following file:

- QtCore/qmap.h