10 #include <QGraphicsItem>
11 #include <QGraphicsPathItem>
12 #include <QGraphicsPolygonItem>
13 #include <QGraphicsScene>
18 m_coordSystemIndexToBeRestored (coordSystemIndexToBeRestored)
28 QList<QGraphicsItem*> items = scene.items();
30 QList<QGraphicsItem*>::iterator itr;
31 for (itr = items.begin(); itr != items.end(); itr++) {
33 QGraphicsItem *item = *itr;
35 QGraphicsEllipseItem *itemEllipse = dynamic_cast<QGraphicsEllipseItem*> (item);
36 if (itemEllipse !=
nullptr) {
40 itemEllipse->brush());
41 m_ellipses.push_back (ghost);
45 QGraphicsPathItem *itemPath = dynamic_cast<QGraphicsPathItem*> (item);
46 if (itemPath !=
nullptr) {
51 m_paths.push_back (ghost);
55 QGraphicsPolygonItem *itemPolygon = dynamic_cast<QGraphicsPolygonItem*> (item);
56 if (itemPolygon !=
nullptr) {
59 QPolygonF polygon = itemPolygon->polygon();
60 polygon.translate (itemPolygon->pos ());
64 itemPolygon->brush());
65 m_polygons.push_back (ghost);
75 return m_coordSystemIndexToBeRestored;
82 for (i = 0; i < m_ellipses.count(); i++) {
85 QGraphicsEllipseItem *item = scene.addEllipse (ghost.
rect());
88 item->setPen (ghost.
pen());
89 item->setBrush (ghost.
brush());
91 item->setVisible (
true);
94 for (i = 0; i < m_paths.count(); i++) {
97 QGraphicsPathItem *item = scene.addPath (ghost.
path(),
103 item->setVisible (
true);
106 for (i = 0; i < m_polygons.count(); i++) {
109 QGraphicsPolygonItem *item = scene.addPolygon (ghost.
polygon(),
115 item->setVisible (
true);
121 QList<QGraphicsItem*> items = scene.items();
122 QList<QGraphicsItem*>::iterator itr;
123 for (itr = items.begin(); itr != items.end(); itr++) {
125 QGraphicsItem *item = *itr;
127 if (!data.isNull()) {
129 scene.removeItem (item);