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

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

Inserts a new item with the key key and a value of value.

If there is already an item with the key key, that item's value is replaced with value.

If there are multiple items with the key key, the most recently inserted item's value is replaced with value.

See also:

Reimplemented in QMultiMap< Key, T >, QMultiMap< QString, QDBusIntrospection::Signal >, QMultiMap< QGraphicsItem *, QGraphicsItem * >, QMultiMap< QByteArray, TokenReplacement * >, QMultiMap< PeerWireClient *, TorrentPiece * >, QMultiMap< QString, QDBusIntrospection::Method >, QMultiMap< QString, QString >, and QMultiMap< QString, QtSimpleXml * >.

Definition at line 493 of file qmap.h.

References QMap< Key, T >::detach().

Referenced by QUiLoader::availableWidgets(), QGLContext::colorIndex(), QExtensionFactory::extension(), QComboBox::insertItem(), QSqlTableModel::insertRows(), QAbstractItemModel::itemData(), Q3TextEdit::optimInsertTag(), Q3HttpHeader::parseLine(), QTextFormat::properties(), QMultiMap< Key, T >::replace(), and QFormBuilder::updateCustomWidgets().


    QMapData::Node *update[QMapData::LastLevel + 1];
    QMapData::Node *node = mutableFindNode(update, akey);
    if (node == e) {
        node = node_create(d, update, akey, avalue);
    } else {
        concrete(node)->value = avalue;
    return iterator(node);

Generated by  Doxygen 1.6.0   Back to index