QtBase  v6.3.1
Classes | Public Types | Public Member Functions | Friends | List of all members
QMap< Key, T > Class Template Reference

#include <qmap.h>

Classes

class  const_iterator
 
class  iterator
 
class  key_iterator
 

Public Types

using key_type = Key
 
using mapped_type = T
 
using difference_type = qptrdiff
 
using size_type = qsizetype
 
typedef QKeyValueIterator< const Key &, const T &, const_iteratorconst_key_value_iterator
 
typedef QKeyValueIterator< const Key &, T &, iteratorkey_value_iterator
 
typedef iterator Iterator
 
typedef const_iterator ConstIterator
 

Public Member Functions

 QMap ()=default
 
void swap (QMap< Key, T > &other) noexcept
 
 QMap (std::initializer_list< std::pair< Key, T >> list)
 
 QMap (const std::map< Key, T > &other)
 
 QMap (std::map< Key, T > &&other)
 
std::map< Key, TtoStdMap () const &
 
std::map< Key, TtoStdMap () &&
 
size_type size () const
 
bool isEmpty () const
 
void detach ()
 
bool isDetached () const noexcept
 
bool isSharedWith (const QMap< Key, T > &other) const noexcept
 
void clear ()
 
size_type remove (const Key &key)
 
template<typename Predicate >
size_type removeIf (Predicate pred)
 
T take (const Key &key)
 
bool contains (const Key &key) const
 
Key key (const T &value, const Key &defaultKey=Key()) const
 
T value (const Key &key, const T &defaultValue=T()) const
 
Toperator[] (const Key &key)
 
T operator[] (const Key &key) const
 
QList< Key > keys () const
 
QList< Key > keys (const T &value) const
 
QList< Tvalues () const
 
size_type count (const Key &key) const
 
size_type count () const
 
const Key & firstKey () const
 
const Key & lastKey () const
 
Tfirst ()
 
const Tfirst () const
 
Tlast ()
 
const Tlast () const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator constBegin () const
 
const_iterator cbegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator constEnd () const
 
const_iterator cend () const
 
key_iterator keyBegin () const
 
key_iterator keyEnd () const
 
key_value_iterator keyValueBegin ()
 
key_value_iterator keyValueEnd ()
 
const_key_value_iterator keyValueBegin () const
 
const_key_value_iterator constKeyValueBegin () const
 
const_key_value_iterator keyValueEnd () const
 
const_key_value_iterator constKeyValueEnd () const
 
iterator erase (const_iterator it)
 
iterator erase (const_iterator afirst, const_iterator alast)
 
iterator find (const Key &key)
 
const_iterator find (const Key &key) const
 
const_iterator constFind (const Key &key) const
 
iterator lowerBound (const Key &key)
 
const_iterator lowerBound (const Key &key) const
 
iterator upperBound (const Key &key)
 
const_iterator upperBound (const Key &key) const
 
iterator insert (const Key &key, const T &value)
 
iterator insert (const_iterator pos, const Key &key, const T &value)
 
void insert (const QMap< Key, T > &map)
 
void insert (QMap< Key, T > &&map)
 
bool empty () const
 
QPair< iterator, iteratorequal_range (const Key &akey)
 
QPair< const_iterator, const_iteratorequal_range (const Key &akey) const
 

Friends

class QMultiMap< Key, T >
 
template<typename AKey = Key, typename AT = T>
QTypeTraits::compare_eq_result_container< QMap, AKey, AToperator== (const QMap &lhs, const QMap &rhs)
 
template<typename AKey = Key, typename AT = T>
QTypeTraits::compare_eq_result_container< QMap, AKey, AToperator!= (const QMap &lhs, const QMap &rhs)
 

Detailed Description

template<class Key, class T>
class QMap< Key, T >

Definition at line 221 of file qmap.h.

Member Typedef Documentation

◆ const_key_value_iterator

template<class Key , class T >
typedef QKeyValueIterator<const Key&, const T&, const_iterator> QMap< Key, T >::const_key_value_iterator

Definition at line 629 of file qmap.h.

◆ ConstIterator

template<class Key , class T >
typedef const_iterator QMap< Key, T >::ConstIterator

Definition at line 670 of file qmap.h.

◆ difference_type

template<class Key , class T >
using QMap< Key, T >::difference_type = qptrdiff

Definition at line 232 of file qmap.h.

◆ Iterator

template<class Key , class T >
typedef iterator QMap< Key, T >::Iterator

Definition at line 669 of file qmap.h.

◆ key_type

template<class Key , class T >
using QMap< Key, T >::key_type = Key

Definition at line 230 of file qmap.h.

◆ key_value_iterator

template<class Key , class T >
typedef QKeyValueIterator<const Key&, T&, iterator> QMap< Key, T >::key_value_iterator

Definition at line 630 of file qmap.h.

◆ mapped_type

template<class Key , class T >
using QMap< Key, T >::mapped_type = T

Definition at line 231 of file qmap.h.

◆ size_type

template<class Key , class T >
using QMap< Key, T >::size_type = qsizetype

Definition at line 233 of file qmap.h.

Constructor & Destructor Documentation

◆ QMap() [1/4]

template<class Key , class T >
QMap< Key, T >::QMap ( )
default

◆ QMap() [2/4]

template<class Key , class T >
QMap< Key, T >::QMap ( std::initializer_list< std::pair< Key, T >>  list)
inline

Definition at line 244 of file qmap.h.

Here is the call graph for this function:

◆ QMap() [3/4]

template<class Key , class T >
QMap< Key, T >::QMap ( const std::map< Key, T > &  other)
inlineexplicit

Definition at line 250 of file qmap.h.

◆ QMap() [4/4]

template<class Key , class T >
QMap< Key, T >::QMap ( std::map< Key, T > &&  other)
inlineexplicit

Definition at line 255 of file qmap.h.

Member Function Documentation

◆ begin() [1/2]

template<class Key , class T >
iterator QMap< Key, T >::begin ( )
inline

Definition at line 633 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ begin() [2/2]

template<class Key , class T >
const_iterator QMap< Key, T >::begin ( ) const
inline

Definition at line 634 of file qmap.h.

◆ cbegin()

template<class Key , class T >
const_iterator QMap< Key, T >::cbegin ( ) const
inline

Definition at line 636 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cend()

template<class Key , class T >
const_iterator QMap< Key, T >::cend ( ) const
inline

Definition at line 640 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

template<class Key , class T >
void QMap< Key, T >::clear ( )
inline

Definition at line 324 of file qmap.h.

Here is the caller graph for this function:

◆ constBegin()

template<class Key , class T >
const_iterator QMap< Key, T >::constBegin ( ) const
inline

Definition at line 635 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ constEnd()

template<class Key , class T >
const_iterator QMap< Key, T >::constEnd ( ) const
inline

Definition at line 639 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ constFind()

template<class Key , class T >
const_iterator QMap< Key, T >::constFind ( const Key &  key) const
inline

Definition at line 686 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ constKeyValueBegin()

template<class Key , class T >
const_key_value_iterator QMap< Key, T >::constKeyValueBegin ( ) const
inline

Definition at line 646 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ constKeyValueEnd()

template<class Key , class T >
const_key_value_iterator QMap< Key, T >::constKeyValueEnd ( ) const
inline

Definition at line 648 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains()

template<class Key , class T >
bool QMap< Key, T >::contains ( const Key &  key) const
inline

Definition at line 376 of file qmap.h.

Here is the caller graph for this function:

◆ count() [1/2]

template<class Key , class T >
size_type QMap< Key, T >::count ( ) const
inline

Definition at line 446 of file qmap.h.

Here is the call graph for this function:

◆ count() [2/2]

template<class Key , class T >
size_type QMap< Key, T >::count ( const Key &  key) const
inline

Definition at line 439 of file qmap.h.

Here is the caller graph for this function:

◆ detach()

template<class Key , class T >
void QMap< Key, T >::detach ( )
inline

Definition at line 306 of file qmap.h.

Here is the caller graph for this function:

◆ empty()

template<class Key , class T >
bool QMap< Key, T >::empty ( ) const
inline

Definition at line 792 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [1/2]

template<class Key , class T >
iterator QMap< Key, T >::end ( )
inline

Definition at line 637 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [2/2]

template<class Key , class T >
const_iterator QMap< Key, T >::end ( ) const
inline

Definition at line 638 of file qmap.h.

◆ equal_range() [1/2]

template<class Key , class T >
QPair<iterator, iterator> QMap< Key, T >::equal_range ( const Key &  akey)
inline

Definition at line 797 of file qmap.h.

◆ equal_range() [2/2]

template<class Key , class T >
QPair<const_iterator, const_iterator> QMap< Key, T >::equal_range ( const Key &  akey) const
inline

Definition at line 805 of file qmap.h.

◆ erase() [1/2]

template<class Key , class T >
iterator QMap< Key, T >::erase ( const_iterator  afirst,
const_iterator  alast 
)
inline

Definition at line 655 of file qmap.h.

◆ erase() [2/2]

template<class Key , class T >
iterator QMap< Key, T >::erase ( const_iterator  it)
inline

Definition at line 650 of file qmap.h.

Here is the caller graph for this function:

◆ find() [1/2]

template<class Key , class T >
iterator QMap< Key, T >::find ( const Key &  key)
inline

Definition at line 672 of file qmap.h.

Here is the caller graph for this function:

◆ find() [2/2]

template<class Key , class T >
const_iterator QMap< Key, T >::find ( const Key &  key) const
inline

Definition at line 679 of file qmap.h.

Here is the caller graph for this function:

◆ first() [1/2]

template<class Key , class T >
T& QMap< Key, T >::first ( )
inline

Definition at line 454 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ first() [2/2]

template<class Key , class T >
const T& QMap< Key, T >::first ( ) const
inline

Definition at line 455 of file qmap.h.

Here is the call graph for this function:

◆ firstKey()

template<class Key , class T >
const Key& QMap< Key, T >::firstKey ( ) const
inline

Definition at line 451 of file qmap.h.

Here is the call graph for this function:

◆ insert() [1/4]

template<class Key , class T >
iterator QMap< Key, T >::insert ( const Key &  key,
const T value 
)
inline

Definition at line 719 of file qmap.h.

Here is the caller graph for this function:

◆ insert() [2/4]

template<class Key , class T >
void QMap< Key, T >::insert ( const QMap< Key, T > &  map)
inline

Definition at line 742 of file qmap.h.

Here is the call graph for this function:

◆ insert() [3/4]

template<class Key , class T >
iterator QMap< Key, T >::insert ( const_iterator  pos,
const Key &  key,
const T value 
)
inline

Definition at line 727 of file qmap.h.

◆ insert() [4/4]

template<class Key , class T >
void QMap< Key, T >::insert ( QMap< Key, T > &&  map)
inline

Definition at line 765 of file qmap.h.

Here is the call graph for this function:

◆ isDetached()

template<class Key , class T >
bool QMap< Key, T >::isDetached ( ) const
inlinenoexcept

Definition at line 314 of file qmap.h.

Here is the caller graph for this function:

◆ isEmpty()

template<class Key , class T >
bool QMap< Key, T >::isEmpty ( ) const
inline

Definition at line 304 of file qmap.h.

Here is the caller graph for this function:

◆ isSharedWith()

template<class Key , class T >
bool QMap< Key, T >::isSharedWith ( const QMap< Key, T > &  other) const
inlinenoexcept

Definition at line 319 of file qmap.h.

Here is the call graph for this function:

◆ key()

template<class Key , class T >
Key QMap< Key, T >::key ( const T value,
const Key &  defaultKey = Key() 
) const
inline

Definition at line 384 of file qmap.h.

Here is the caller graph for this function:

◆ keyBegin()

template<class Key , class T >
key_iterator QMap< Key, T >::keyBegin ( ) const
inline

Definition at line 641 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyEnd()

template<class Key , class T >
key_iterator QMap< Key, T >::keyEnd ( ) const
inline

Definition at line 642 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keys() [1/2]

template<class Key , class T >
QList<Key> QMap< Key, T >::keys ( ) const
inline

Definition at line 418 of file qmap.h.

Here is the caller graph for this function:

◆ keys() [2/2]

template<class Key , class T >
QList<Key> QMap< Key, T >::keys ( const T value) const
inline

Definition at line 425 of file qmap.h.

◆ keyValueBegin() [1/2]

template<class Key , class T >
key_value_iterator QMap< Key, T >::keyValueBegin ( )
inline

Definition at line 643 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyValueBegin() [2/2]

template<class Key , class T >
const_key_value_iterator QMap< Key, T >::keyValueBegin ( ) const
inline

Definition at line 645 of file qmap.h.

Here is the call graph for this function:

◆ keyValueEnd() [1/2]

template<class Key , class T >
key_value_iterator QMap< Key, T >::keyValueEnd ( )
inline

Definition at line 644 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyValueEnd() [2/2]

template<class Key , class T >
const_key_value_iterator QMap< Key, T >::keyValueEnd ( ) const
inline

Definition at line 647 of file qmap.h.

Here is the call graph for this function:

◆ last() [1/2]

template<class Key , class T >
T& QMap< Key, T >::last ( )
inline

Definition at line 456 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ last() [2/2]

template<class Key , class T >
const T& QMap< Key, T >::last ( ) const
inline

Definition at line 457 of file qmap.h.

Here is the call graph for this function:

◆ lastKey()

template<class Key , class T >
const Key& QMap< Key, T >::lastKey ( ) const
inline

Definition at line 452 of file qmap.h.

Here is the call graph for this function:

◆ lowerBound() [1/2]

template<class Key , class T >
iterator QMap< Key, T >::lowerBound ( const Key &  key)
inline

Definition at line 691 of file qmap.h.

Here is the caller graph for this function:

◆ lowerBound() [2/2]

template<class Key , class T >
const_iterator QMap< Key, T >::lowerBound ( const Key &  key) const
inline

Definition at line 698 of file qmap.h.

◆ operator[]() [1/2]

template<class Key , class T >
T& QMap< Key, T >::operator[] ( const Key &  key)
inline

Definition at line 402 of file qmap.h.

◆ operator[]() [2/2]

template<class Key , class T >
T QMap< Key, T >::operator[] ( const Key &  key) const
inline

Definition at line 413 of file qmap.h.

Here is the call graph for this function:

◆ remove()

template<class Key , class T >
size_type QMap< Key, T >::remove ( const Key &  key)
inline

Definition at line 335 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeIf()

template<class Key , class T >
template<typename Predicate >
size_type QMap< Key, T >::removeIf ( Predicate  pred)
inline

Definition at line 352 of file qmap.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size()

template<class Key , class T >
size_type QMap< Key, T >::size ( ) const
inline

Definition at line 302 of file qmap.h.

Here is the caller graph for this function:

◆ swap()

template<class Key , class T >
void QMap< Key, T >::swap ( QMap< Key, T > &  other)
inlinenoexcept

Definition at line 239 of file qmap.h.

Here is the call graph for this function:

◆ take()

template<class Key , class T >
T QMap< Key, T >::take ( const Key &  key)
inline

Definition at line 357 of file qmap.h.

Here is the caller graph for this function:

◆ toStdMap() [1/2]

template<class Key , class T >
std::map<Key, T> QMap< Key, T >::toStdMap ( ) &&
inline

Definition at line 267 of file qmap.h.

◆ toStdMap() [2/2]

template<class Key , class T >
std::map<Key, T> QMap< Key, T >::toStdMap ( ) const &
inline

Definition at line 260 of file qmap.h.

Here is the caller graph for this function:

◆ upperBound() [1/2]

template<class Key , class T >
iterator QMap< Key, T >::upperBound ( const Key &  key)
inline

Definition at line 705 of file qmap.h.

◆ upperBound() [2/2]

template<class Key , class T >
const_iterator QMap< Key, T >::upperBound ( const Key &  key) const
inline

Definition at line 712 of file qmap.h.

◆ value()

template<class Key , class T >
T QMap< Key, T >::value ( const Key &  key,
const T defaultValue = T() 
) const
inline

Definition at line 392 of file qmap.h.

Here is the caller graph for this function:

◆ values()

template<class Key , class T >
QList<T> QMap< Key, T >::values ( ) const
inline

Definition at line 432 of file qmap.h.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator!=

template<class Key , class T >
template<typename AKey = Key, typename AT = T>
QTypeTraits::compare_eq_result_container<QMap, AKey, AT> operator!= ( const QMap< Key, T > &  lhs,
const QMap< Key, T > &  rhs 
)
friend

Definition at line 292 of file qmap.h.

◆ operator==

template<class Key , class T >
template<typename AKey = Key, typename AT = T>
QTypeTraits::compare_eq_result_container<QMap, AKey, AT> operator== ( const QMap< Key, T > &  lhs,
const QMap< Key, T > &  rhs 
)
friend

Definition at line 281 of file qmap.h.

◆ QMultiMap< Key, T >

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

Definition at line 225 of file qmap.h.


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