QGraphicsItem* item = new QGraphicsItem(); item->setPos(100,100);
QGraphicsItem* item = new QGraphicsItem(); item->setPos(item->pos() + QPointF(10,20));This code creates a new QGraphicsItem and moves it to a position 10 pixels to the right and 20 pixels below its current position using the setPos() function. Package Library: Qt (QtCore, QtGui, QtWidgets)