The goal is to draw the following:
Qt Code:
  1. +-----------------+ +-----------------+
  2. | | | |
  3. | |[]------\ | |[] - - - -
  4. | PIXMAP | \-[]| PIXMAP | OTHER OBJECTS
  5. | |[] | |[] - - - -
  6. | | | |
  7. +-----------------+ +-----------------+
  8. Object Nr.1 Object_2
To copy to clipboard, switch view to plain text mode 
Each Object has 0 - n connectors on each side, in the middle a QGraphicsPixmapItem and under the object in the middle the Object name.
Between the connectors i would like to add a line which moves also if one of the connected objects moves (like Visio)

Currently i have the QGraphicsPixmapItem implemented, but i don't know how to implement the QGraphicsTextItem and the lines between the connectors and the connectors self.

@aamer4yu: I tried to put the following in my class (inherited from QGraphicsPixmapItem) as follows:
Qt Code:
  1. DiagramImageItem::DiagramImageItem(DiagramType diagramType, QMenu *contextMenu,
  2. QGraphicsItem *parent, QGraphicsScene *scene)
  3. : QGraphicsPixmapItem(parent, scene)
  4. {
  5.  
  6. connect(scene, SIGNAL(retrieveItemData(const QString&, const QVariant&)),
  7. this, SLOT(retrieveItemData(const QString&, const QVariant&)));
  8. obj_id++;
  9. myDiagramType = diagramType;
  10. myContextMenu = contextMenu;
  11.  
  12. this->obj_name = object_name.toLower();
  13. this->obj_type_str = object_type;
  14. this->obj_type = myDiagramType;
  15. setToolTip(this->obj_name);
  16. setObjectName(object_name);
  17.  
  18. setFlag(QGraphicsItem::ItemIsMovable, true);
  19. setFlag(QGraphicsItem::ItemIsSelectable, true);
  20.  
  21. textItem = new DiagramTextItem();
  22. textItem->setPlainText(this->obj_name);
  23. textItem->setFont(QFont("courier"));//myFont);
  24. //textItem->setTextInteractionFlags(Qt::TextEditorInteraction);
  25. textItem->setZValue(this->zValue());
  26. textItem->setDefaultTextColor(QColor(0, 0, 0));//myTextColor);
  27. textItem->setPos(this->pos().x()+20, this->pos().y()+100);//+266);//mouseEvent->scenePos());
  28. this->scene()->addItem(textItem);
  29. // addItem(textItem);
  30. }
To copy to clipboard, switch view to plain text mode 

Put i didn't see any text. As base of the code i used the diagram example from QT 4.3

Kind Regards
NoRulez