mScene
->addPixmap
(QPixmap::fromImage(IplImageToQImage
(img
)));
mScene->addPixmap(QPixmap::fromImage(IplImageToQImage(img)));
To copy to clipboard, switch view to plain text mode
You should only call addPixmap() once. Otherwise all the previous frames remain in the scene behind the current frame.
Keep a reference instead:
// Do once:
// Update:
pixItem
->setPixmap
(QPixmap::fromImage(IplImageToQImage
(img
)));
// Do once:
QGraphicsPixmapItem* pixItem = mScene->addPixmap(QPixmap::fromImage(IplImageToQImage(img)));
// Update:
pixItem->setPixmap(QPixmap::fromImage(IplImageToQImage(img)));
To copy to clipboard, switch view to plain text mode
No need to call update(). The item takes care of that for itself.
Bookmarks