C++ (Qt) std::shared_ptr<myShapes::Shape> pc(new myShapes::Circle(50.0)); pc->setRadius(25.0);
C++ (Qt)void Viewer::draw(std::shared_ptr<myShapes::Shape> ps, int xOffset, int yOffset)
C++ (Qt)(myShapes::Shape)pc->setRadius(25.0);
void Viewer::draw(Shape * ps, int xOffset, int yOffset)
C++ (Qt)int main(int argc, char *argv[]){ QApplication a(argc, argv); Viewer viewer; viewer.resize(400, 200); myShapes::Shape *pr1 = new myShapes::Rectangle(5.0, 10.0); myShapes::Shape *pr2 = new myShapes::Rectangle(5.0, 10.0); myShapes::Shape *pr3 = new myShapes::Rectangle(5.0, 10.0); myShapes::Shape *pr4 = new myShapes::Rectangle(5.0, 10.0); myShapes::Shape *pr5 = new myShapes::Rectangle(5.0, 10.0); viewer.addForPainting(*pr1); viewer.addForPainting(*pr2); viewer.addForPainting(*pr3); viewer.addForPainting(*pr4); viewer.addForPainting(*pr5); delete pr1; delete pr2; delete pr3; delete pr4; delete pr5; viewer.show(); return a.exec();}