Search code examples
c++qtqgridlayout

How to position item, Qpixmap, Qstring in a QGraphicScene/QGraphicView in qt?


I add a Qpixmap and a string into QgraphicScene and then setScene into QgraphicView. This Qpixmap and string stay in the middle of the QgRaphicScene. How can i change the position of these? Can i use layout manager for this?


Solution

  • You can use the QGraphicsItem::setPos function to set the position of an item.