Obsolete Members for QMap

以下成员源于类 QMap 已过时。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。

公共函数

(obsolete) QMap::iterator insertMulti (const Key & key , const T & value )
(obsolete) QMap::iterator insertMulti (QMap::const_iterator pos , const Key & key , const T & value )
(obsolete) QList<Key> uniqueKeys () const
(obsolete) QMap<Key, T> & unite (const QMap<Key, T> & other )
(obsolete) QList<T> values (const Key & key ) const

成员函数文档编制

QMap::iterator QMap:: insertMulti (const Key & key , const T & value )

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

使用 QMultiMap for storing multiple values with the same key.

Inserts a new item with the key key 和值 value .

If there is already an item with the same key in the map, this function will simply create a new one. (This behavior is different from insert (), which overwrites the value of an existing item.)

另请参阅 QMultiMap::insert ().

QMap::iterator QMap:: insertMulti ( QMap::const_iterator pos , const Key & key , const T & value )

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

这是重载函数。

使用 QMultiMap for storing multiple values with the same key. Inserts a new item with the key key and value value and with hint pos suggesting where to do the insert.

constBegin () is used as hint it indicates that the key is less than any key in the map while constEnd () suggests that the key is larger than any key in the map. Otherwise the hint should meet the condition ( pos - 1). key () < key <= pos. key (). If the hint pos is wrong it is ignored and a regular insertMulti is done.

If there is already an item with the same key in the map, this function will simply create a new one.

注意: Be careful with the hint. Providing an iterator from an older shared instance might crash but there is also a risk that it will silently corrupt both the map and the pos map.

该函数在 Qt 5.1 引入。

另请参阅 QMultiMap::insert ().

QList < Key > QMap:: uniqueKeys () const

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

使用 QMultiMap for storing multiple values with the same key.

Returns a list containing all the keys in the map in ascending order. Keys that occur multiple times in the map (because items were inserted with insertMulti (),或 unite () was used) occur only once in the returned list.

该函数在 Qt 4.2 引入。

另请参阅 QMultiMap::uniqueKeys ().

QMap < Key , T > &QMap:: unite (const QMap < Key , T > & other )

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

使用 QMultiMap for storing multiple values with the same key.

Inserts all the items in the other map into this map. If a key is common to both maps, the resulting map will contain the key multiple times.

另请参阅 QMultiMap::unite ().

QList < T > QMap:: values (const Key & key ) const

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

这是重载函数。

使用 QMultiMap for maps storing multiple values with the same key.

Returns a list containing all the values associated with key key , from the most recently inserted to the least recently inserted one.

另请参阅 QMultiMap::values ().