void initTestCase();
private slots:
- void customIndex_data();
- void customIndex();
void scatteredItems_data();
void scatteredItems();
void overlappedItems_data();
return index;
}
-void tst_QGraphicsSceneIndex::customIndex_data()
-{
- common_data();
-}
-
-void tst_QGraphicsSceneIndex::customIndex()
-{
-#if 0
- QFETCH(QString, indexMethod);
- QGraphicsSceneIndex *index = createIndex(indexMethod);
-
- QGraphicsScene scene;
- scene.setSceneIndex(index);
-
- scene.addRect(0, 0, 30, 40);
- QCOMPARE(scene.items(QRectF(0, 0, 10, 10)).count(), 1);
-#endif
-}
-
void tst_QGraphicsSceneIndex::scatteredItems_data()
{
common_data();
QFETCH(QString, indexMethod);
QGraphicsScene scene;
-#if 1
scene.setItemIndexMethod(indexMethod == "linear" ? QGraphicsScene::NoIndex : QGraphicsScene::BspTreeIndex);
-#else
- QGraphicsSceneIndex *index = createIndex(indexMethod);
- scene.setSceneIndex(index);
-#endif
for (int i = 0; i < 10; ++i)
scene.addRect(i*50, i*50, 40, 35);
QFETCH(QString, indexMethod);
QGraphicsScene scene;
-#if 1
scene.setItemIndexMethod(indexMethod == "linear" ? QGraphicsScene::NoIndex : QGraphicsScene::BspTreeIndex);
-#else
- QGraphicsSceneIndex *index = createIndex(indexMethod);
- scene.setSceneIndex(index);
-#endif
for (int i = 0; i < 10; ++i)
for (int j = 0; j < 10; ++j)
QFETCH(QString, indexMethod);
QGraphicsScene scene;
-#if 1
scene.setItemIndexMethod(indexMethod == "linear" ? QGraphicsScene::NoIndex : QGraphicsScene::BspTreeIndex);
-#else
- QGraphicsSceneIndex *index = createIndex(indexMethod);
- scene.setSceneIndex(index);
-#endif
for (int i = 0; i < 10; ++i)
scene.addRect(i*50, i*50, 40, 35);