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

QList< QGraphicsItem * > QGraphicsScene::items (  )  const

Returns a list of all items on the scene, in no particular order.

See also:
addItem(), removeItem()

Definition at line 1654 of file qgraphicsscene.cpp.

Referenced by advance(), contextMenuEvent(), event(), itemAt(), items(), itemsBoundingRect(), DiagramScene::mouseReleaseEvent(), QGraphicsView::paintEvent(), render(), setActiveWindow(), setSelectionArea(), setStyle(), Mouse::timerEvent(), and View::updateImage().

{
    Q_D(const QGraphicsScene);
    const_cast<QGraphicsScenePrivate *>(d)->purgeRemovedItems();

    // If freeItemIndexes is empty, we know there are no holes in indexedItems and
    // unindexedItems.
    if (d->freeItemIndexes.isEmpty()) {
        if (d->unindexedItems.isEmpty())
            return d->indexedItems;
        return d->indexedItems + d->unindexedItems;
    }

    // Rebuild the list of items to avoid holes. ### We could also just
    // compress the item lists at this point.
    QList<QGraphicsItem *> itemList;
    foreach (QGraphicsItem *item, d->indexedItems + d->unindexedItems) {
        if (item)
            itemList << item;
    }
    return itemList;
}


Generated by  Doxygen 1.6.0   Back to index