c++ - How to actually remove a QGraphicsItem from the screen? -


i've got qgraphicsitem (a map) has children (icons on map). no issues far.

however, want able remove icons screen. in order this, tried break parent-children relationship:

foreach(qgraphicsitem* item, displayedicons) {     item->setparentitem(null); } 

in way, map , icons detached each other, i.e. when pan map, icons remain @ absolute position on screen. problem is, icons still displayed @ all.

is there missing in order remove icons screen?

use qgraphicsscene::removeitem().


Comments