QGraphicsRectItem *item[15] = new QGraphicsRectItem();
bool QGraphicsItem::collidesWithItem ( const QGraphicsItem * other, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape ) const [virtual]
C++ (Qt)QList<QGraphicsRectItem *>items; for (int i = 0; i < 15; i++) { items.append(new QGraphicsRectItem());}
C++ (Qt)qDeleteAll(list.begin(), list.end());list.clear();
QGraphicsScene * scene = new QGraphicsScene; scene->setSceneRect(QRectF(-500,-500,1000,1000)); graphicsView->setScene(scene); QList<QGraphicsRectItem *>item; int i; for (int i = 1; i < 16; i++) { item.append(new QGraphicsRectItem()); } item[1]->setRect(QRectF(-410, 210.0, 160.0, 50.0)); scene->addItem(item[1]);
for (i=3;i< 16;i++) {item[i]->setRect(QRectF(-410.0+i*5, 160.0, 160.0-10*i, 50.0)); scene->addItem(item[i]);}
qDeleteAll(item.begin(), item.end()); item.clear();