2012-07-02 1 views

답변

1

예, QGraphicsItem::setPos() 메서드를 사용해야합니다. QGraphicsPixmapItem을 추가 했으므로 다음과 같이 표시 될 수 있습니다.

QGraphicsScene *scene = ... ; // your scene 
QImage image = ... ; // the QImage you want to add to the scene 
QPixmap pixmap = QPixmap::fromImage(image) ; 

// add image item to the scene 
QGraphicsPixmapItem * imageItem = scene->addPixmap(pixmap) ; 

// modify item's position in scene coordinates 
QPointF imagePos = ... ; // whatever scene pos you want 
imageItem->setPos(imagePos) ; 
관련 문제