I am using the code from the Diagram example ,

I want to be able to add pictures to the scene, i ALMOST have it working but i can not figure out how to use a QGraphicspixmapItem with this function. It returns error that QGraphicsmap* can not be converted QGraphicsPixmapItem. how can i do this ?

Qt Code:
  1. foreach (QGraphicsItem *item, scene->selectedItems()) {
  2. if (item->type() == DiagramItem::Type) {
  3. qgraphicsitem_cast<DiagramItem *>(item);
  4. }
  5.  
  6. int x= item->boundingRect().center().x();
  7. int y= item->boundingRect().center().y();
  8. if(ui->rotateButton->isChecked())
  9. {item->setTransform(QTransform().translate(x, y).rotate(-value).translate(-x, -y));db->updateAngle(-value);}
  10. else
  11. {item->setTransform(QTransform().translate(x, y).rotate(value).translate(-x, -y));db->updateAngle(value);}
  12. }
To copy to clipboard, switch view to plain text mode