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

template<typename T>
void QList< T >::insert ( int  i,
const T &  value 
) [inline, inherited]

Inserts value at index position i in the list. If i is 0, the value is prepended to the list. If i is size(), the value is appended to the list.

Example: doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 8

See also:
append(), prepend(), replace(), removeAt()

Definition at line 446 of file qlist.h.

References QList< T >::detach().

Referenced by QObjectCleanupHandler::add(), QTreeWidgetItem::clone(), QNetworkCookieJar::cookiesForUrl(), QTreeWidgetItem::insertChild(), QTreeWidgetItem::insertChildren(), TreeItem::insertChildren(), TableModel::insertColumns(), TreeItem::insertColumns(), TableModel::insertRows(), QStringListModel::insertRows(), StringListModel::insertRows(), QGraphicsItem::mouseReleaseEvent(), Q3DockArea::moveDockWindow(), Q3ImageDrag::setImage(), and QList< T >::toSet().

    if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
        node_construct(reinterpret_cast<Node *>(p.insert(i)), t);
    } else {
        const T cpy(t);
        node_construct(reinterpret_cast<Node *>(p.insert(i)), cpy);

Generated by  Doxygen 1.6.0   Back to index