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

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

Replaces the item at index position i with value. i must be a valid index position in the list (i.e., 0 <= i < size()).

See also:
operator[](), removeAt()

Definition at line 458 of file qlist.h.

References QList< T >::detach().

Referenced by Q3FileDialog::getOpenFileNames(), QStringListModel::setData(), TreeItem::setData(), StringListModel::setData(), QPatternist::AddingAggregate::typeCheck(), and QPatternist::AvgFN::typeCheck().

    Q_ASSERT_X(i >= 0 && i < p.size(), "QList<T>::replace", "index out of range");
    if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
        reinterpret_cast<Node *>(p.at(i))->t() = t;
    } else {
        const T cpy(t);
        reinterpret_cast<Node *>(p.at(i))->t() = cpy;

Generated by  Doxygen 1.6.0   Back to index