portN->setPos(0, -25);
portS->setPos(0, 25);
scene.addItem(rect);
v.setScene(&scene);
v.show();
QGraphicsRectItem *rect = new QGraphicsRectItem(QRectF(-50, -25, 100, 50));
rect->setFlags(QGraphicsItem::ItemIsMovable);
QGraphicsTextItem *text = new QGraphicsTextItem(rect);
QGraphicsEllipseItem *portN = new QGraphicsEllipseItem(QRectF(-5, -5, 10, 10), rect);
portN->setPos(0, -25);
QGraphicsEllipseItem *portS = new QGraphicsEllipseItem(QRectF(-5, -5, 10, 10), rect);
portS->setPos(0, 25);
QGraphicsScene scene;
scene.addItem(rect);
QGraphicsView v;
v.setScene(&scene);
v.show();
To copy to clipboard, switch view to plain text mode
Bookmarks