I added some pixelmaps to a QGraphicsScene:

Qt Code:
  1. self.scene.addPixmap(cityPixmap)
To copy to clipboard, switch view to plain text mode 

and it works fine...


Then I usa for loop to get all the pixelmap like this:

Qt Code:
  1. for obj in self.scene.items():
  2. print 'obj'
To copy to clipboard, switch view to plain text mode 

this also works fine...


But my question is:

say I add some city pixelmaps and some river pixelmaps to the scene, now I want to remove all the river pixelmaps:

Qt Code:
  1. for obj in self.scene.items():
  2. if type(obj) == QGraphicsPixmapItem:
  3. #do the remove stuff
To copy to clipboard, switch view to plain text mode 

but how I can tell the QGraphicsPixmapItem object I got is a river or a city ?

Any reply will be appreciated, thanks