void TestShapePainting::testPaintHiddenShape() { MockShape shape; MockContainer fourth; MockContainer thirth; MockContainer second; MockContainer top; top.addShape(&second); second.addShape(&thirth); thirth.addShape(&fourth); fourth.addShape(&shape); second.setVisible(false); MockCanvas canvas; KShapeManager manager(&canvas); manager.addShape(&top); QCOMPARE(manager.shapes().count(), 5); QImage image(100, 100, QImage::Format_Mono); QPainter painter(&image); KViewConverter vc; manager.paint(painter, vc, false); QCOMPARE(top.paintedCount, 1); QCOMPARE(second.paintedCount, 0); QCOMPARE(thirth.paintedCount, 0); QCOMPARE(fourth.paintedCount, 0); QCOMPARE(shape.paintedCount, 0); }
void TestShapePainting::testPaintHiddenShape() { MockShape *shape = new MockShape(); MockContainer *fourth = new MockContainer(); MockContainer *thirth = new MockContainer(); MockContainer *second = new MockContainer(); MockContainer *top = new MockContainer(); top->addShape(second); second->addShape(thirth); thirth->addShape(fourth); fourth->addShape(shape); second->setVisible(false); MockCanvas canvas; KoShapeManager manager(&canvas); manager.addShape(top); QCOMPARE(manager.shapes().count(), 5); QImage image(100, 100, QImage::Format_Mono); QPainter painter(&image); KoViewConverter vc; manager.paint(painter, vc, false); QCOMPARE(top->paintedCount, 1); QCOMPARE(second->paintedCount, 0); QCOMPARE(thirth->paintedCount, 0); QCOMPARE(fourth->paintedCount, 0); QCOMPARE(shape->paintedCount, 0); delete top; }