equal
deleted
inserted
replaced
274 void polishItems(); |
274 void polishItems(); |
275 void polishItems2(); |
275 void polishItems2(); |
276 void isActive(); |
276 void isActive(); |
277 void siblingIndexAlwaysValid(); |
277 void siblingIndexAlwaysValid(); |
278 void removeFullyTransparentItem(); |
278 void removeFullyTransparentItem(); |
|
279 void zeroScale(); |
279 |
280 |
280 // task specific tests below me |
281 // task specific tests below me |
281 void task139710_bspTreeCrash(); |
282 void task139710_bspTreeCrash(); |
282 void task139782_containsItemBoundingRect(); |
283 void task139782_containsItemBoundingRect(); |
283 void task176178_itemIndexMethodBreaksSceneRect(); |
284 void task176178_itemIndexMethodBreaksSceneRect(); |
1489 firstItem->items += secondItem; |
1490 firstItem->items += secondItem; |
1490 |
1491 |
1491 scene.setItemIndexMethod(QGraphicsScene::NoIndex); |
1492 scene.setItemIndexMethod(QGraphicsScene::NoIndex); |
1492 scene.addItem(firstItem); |
1493 scene.addItem(firstItem); |
1493 scene.addItem(secondItem); |
1494 scene.addItem(secondItem); |
1494 QCOMPARE(scene.items().at(0), firstItem); |
1495 QCOMPARE(scene.items().at(0), (QGraphicsItem*)firstItem); |
1495 QCOMPARE(scene.items().at(1), secondItem); |
1496 QCOMPARE(scene.items().at(1), secondItem); |
1496 |
1497 |
1497 ClearTestItem *thirdItem = new ClearTestItem(firstItem); |
1498 ClearTestItem *thirdItem = new ClearTestItem(firstItem); |
1498 QGraphicsItem *forthItem = new QGraphicsRectItem(firstItem); |
1499 QGraphicsItem *forthItem = new QGraphicsRectItem(firstItem); |
1499 thirdItem->items += forthItem; |
1500 thirdItem->items += forthItem; |
4562 |
4563 |
4563 delete view; |
4564 delete view; |
4564 } |
4565 } |
4565 } |
4566 } |
4566 |
4567 |
|
4568 void tst_QGraphicsScene::zeroScale() |
|
4569 { |
|
4570 //should not crash |
|
4571 QGraphicsScene scene; |
|
4572 scene.setSceneRect(-100, -100, 100, 100); |
|
4573 QGraphicsView view(&scene); |
|
4574 |
|
4575 ChangedListener cl; |
|
4576 connect(&scene, SIGNAL(changed(const QList<QRectF> &)), &cl, SLOT(changed(const QList<QRectF> &))); |
|
4577 |
|
4578 QGraphicsRectItem *rect1 = new QGraphicsRectItem(0, 0, 0.0000001, 0.00000001); |
|
4579 scene.addItem(rect1); |
|
4580 rect1->setRotation(82); |
|
4581 rect1->setScale(0.00000001); |
|
4582 |
|
4583 QApplication::processEvents(); |
|
4584 QTRY_COMPARE(cl.changes.count(), 1); |
|
4585 QGraphicsRectItem *rect2 = new QGraphicsRectItem(-0.0000001, -0.0000001, 0.0000001, 0.0000001); |
|
4586 rect2->setScale(0.00000001); |
|
4587 scene.addItem(rect2); |
|
4588 rect1->setPos(20,20); |
|
4589 QApplication::processEvents(); |
|
4590 QTRY_COMPARE(cl.changes.count(), 2); |
|
4591 } |
|
4592 |
4567 QTEST_MAIN(tst_QGraphicsScene) |
4593 QTEST_MAIN(tst_QGraphicsScene) |
4568 #include "tst_qgraphicsscene.moc" |
4594 #include "tst_qgraphicsscene.moc" |