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

template<typename T >
T QList< T >::takeFirst (  ) [inline, inherited]

Removes the first item in the list and returns it. This is the same as takeAt(0). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function.

This operation is very fast ({constant time}), because QList preallocates extra space on both sides of its internal buffer to allow for fast growth at both ends of the list.

If you don't use the return value, removeFirst() is more efficient.

See also:
takeLast(), takeAt(), removeFirst()

Definition at line 415 of file qlist.h.

References QList< T >::first(), and QList< T >::removeFirst().

Referenced by QAbstractSocketPrivate::_q_connectToNextAddress(), QUndoStackPrivate::checkUndoLimit(), QObjectCleanupHandler::clear(), QDBusConnectionPrivate::customEvent(), QQueue< T >::dequeue(), QTreeWidget::dropEvent(), QTableWidget::dropEvent(), QListWidget::dropEvent(), QODBCResult::exec(), QDB2Result::exec(), QFontEngine::expireGlyphCache(), QScriptDebuggerPrivate::maybeStartNewJob(), QThreadPoolThread::run(), QHostInfoAgent::run(), FileManager::run(), QAction::setShortcuts(), QThreadPoolPrivate::startFrontRunnable(), View::updateImage(), Q3ActionGroup::~Q3ActionGroup(), and Q3DockArea::~Q3DockArea().

{ T t = first(); removeFirst(); return t; }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index