+-----------------+ +-----------------+
| | | |
| |[]------\ | |[] - - - -
| PIXMAP | \-[]| PIXMAP | OTHER OBJECTS
| |[] | |[] - - - -
| | | |
+-----------------+ +-----------------+
Object Nr.1 Object_2
+-----------------+ +-----------------+
| | | |
| |[]------\ | |[] - - - -
| PIXMAP | \-[]| PIXMAP | OTHER OBJECTS
| |[] | |[] - - - -
| | | |
+-----------------+ +-----------------+
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.
DiagramImageItem
::DiagramImageItem(DiagramType diagramType,
QMenu *contextMenu,
{
connect(scene, SIGNAL(retrieveItemData(const QString&, const QVariant&)),
this, SLOT(retrieveItemData(const QString&, const QVariant&)));
obj_id++;
myDiagramType = diagramType;
myContextMenu = contextMenu;
this->obj_name = object_name.toLower();
this->obj_type_str = object_type;
this->obj_type = myDiagramType;
setToolTip(this->obj_name);
setObjectName(object_name);
textItem = new DiagramTextItem();
textItem->setPlainText(this->obj_name);
textItem
->setFont
(QFont("courier"));
//myFont); //textItem->setTextInteractionFlags(Qt::TextEditorInteraction);
textItem->setZValue(this->zValue());
textItem
->setDefaultTextColor
(QColor(0,
0,
0));
//myTextColor); textItem->setPos(this->pos().x()+20, this->pos().y()+100);//+266);//mouseEvent->scenePos());
this->scene()->addItem(textItem);
// addItem(textItem);
}
DiagramImageItem::DiagramImageItem(DiagramType diagramType, QMenu *contextMenu,
QGraphicsItem *parent, QGraphicsScene *scene)
: QGraphicsPixmapItem(parent, scene)
{
connect(scene, SIGNAL(retrieveItemData(const QString&, const QVariant&)),
this, SLOT(retrieveItemData(const QString&, const QVariant&)));
obj_id++;
myDiagramType = diagramType;
myContextMenu = contextMenu;
this->obj_name = object_name.toLower();
this->obj_type_str = object_type;
this->obj_type = myDiagramType;
setToolTip(this->obj_name);
setObjectName(object_name);
setFlag(QGraphicsItem::ItemIsMovable, true);
setFlag(QGraphicsItem::ItemIsSelectable, true);
textItem = new DiagramTextItem();
textItem->setPlainText(this->obj_name);
textItem->setFont(QFont("courier"));//myFont);
//textItem->setTextInteractionFlags(Qt::TextEditorInteraction);
textItem->setZValue(this->zValue());
textItem->setDefaultTextColor(QColor(0, 0, 0));//myTextColor);
textItem->setPos(this->pos().x()+20, this->pos().y()+100);//+266);//mouseEvent->scenePos());
this->scene()->addItem(textItem);
// addItem(textItem);
}
To copy to clipboard, switch view to plain text mode
Bookmarks