QMap Class Reference
该类提供一个skip-list-based(基于跳过清单)字典。
#include <QMap>
注意:所有的函数是可重入的。
公共类型:
class
class
typedef
typedef
typedef
typedef
typedef
typedef
公共函数:

QMap
 ()
QMap ( const QMap<Key, T> & other )
QMap ( const std::map<Key, T> & other )
~QMap ()
iterator
begin ()
const_iterator
begin () const
void
clear ()
const_iterator
constBegin () const
const_iterator
constEnd () const
const_iterator
constFind ( const Key & key ) const
bool
contains ( const Key & key ) const
int
count ( const Key & key ) const
int
count () const
bool
empty () const
iterator
end ()
const_iterator
end () const
iterator
erase ( iterator pos )
iterator
find ( const Key & key )
const_iterator
find ( const Key & key ) const
iterator
insert ( const Key & key, const T & value )
iterator
insertMulti ( const Key & key, const T & value )
bool
isEmpty () const
const Key
key ( const T & value ) const
const Key
key ( const T & value, const Key & defaultKey ) const
QList<Key>
keys () const
QList<Key>
keys ( const T & value ) const
iterator
lowerBound ( const Key & key )
const_iterator
lowerBound ( const Key & key ) const
int
remove ( const Key & key )
int
size () const
T
take ( const Key & key )
std::map<Key, T>
toStdMap () const
QList<Key>
uniqueKeys () const
QMap<Key, T> &
unite ( const QMap<Key, T> & other )
iterator
upperBound ( const Key & key )
const_iterator
upperBound ( const Key & key ) const
const T
value ( const Key & key ) const
const T
value ( const Key & key, const T & defaultValue ) const
QList<T>
values () const
QList<T>
values ( const Key & key ) const
bool
operator!= ( const QMap<Key, T> & other ) const
QMap<Key, T> &
operator= ( const QMap<Key, T> & other )
bool
operator== ( const QMap<Key, T> & other ) const
T &
operator[] ( const Key & key )
const T
operator[] ( const Key & key ) const
相关的非成员:
QDataStream &
operator<< ( QDataStream & out, const QMap<Key, T> &map )
QDataStream &
operator>> ( QDataStream & in, QMap<Key, T> & map )
 
详细描述:
QMap<Key,T>是一个qt的一般的容器类。他存储(key,value)成对的,提供快速的查找与key相关的值。
QMapQHash提供很相似的函数,不同的是:
QHash提供更快的查找。
当迭代一个QHash,项目是任意的顺序。使用QMap,项目总是按照key存储。
一个QHashKey类型必须提供==()和一个全局的qHashKey)函数。一个QMapKey类型必须提供<()说明一个总的顺序。