Same principle as a brush. In Qt, QPixmap instances are reference-counted, so there is no overhead associated with changing the pixmap for a QGraphicsPixmapItem. QGraphicsPixmapItem::setPixmap() takes a const reference to a QPixmap, which implies that the graphics item stores a local copy, but that's not necessarily the case. Even when setting a pixmap is pass-by-value, the reference counting means that no actual copy is made unless the target of the copy modifies the original pixmap (ie. copy-on-write semantics apply).(as pixmaps are a possibility)
Bookmarks