qt - How to put several QImage in a QGraphicsView? -


i have scene several items added. problem when items displayed, overlapping. there way indicate in qgraphicsview or qgraphicsscene position each item should appear?

yes, have use qgraphicsitem::setpos() method. suppose added qgraphicspixmapitem, :

qgraphicsscene *scene = ... ; // scene qimage image = ... ; // qimage want add scene qpixmap pixmap = qpixmap::fromimage(image) ;  // add image item scene qgraphicspixmapitem * imageitem = scene->addpixmap(pixmap) ;  // modify item's position in scene coordinates qpointf imagepos = ... ; // whatever scene pos want imageitem->setpos(imagepos) ; 

Comments

Popular posts from this blog

All overlapping substrings matching a java regex -

c++ - Using OpenSSL in a multi-threaded application -

php - Deleting/Renaming a locked file -