You can use dynamic_cast
to cast the QGraphicsItem
s to your custom class that inherits from QGraphicsItem when you get a list of selected items in the scene.
Example:
QList<QGraphicsItem*> list = scene->selectedItems();
for(int i = 0; i < list.length(); i++)
{
CustomItem *item = dynamic_cast<CustomItem*>(list[i]);
}