Neel Basu
Neel Basu

Reputation: 12894

QImage copy on write

is QImage based on QSharedData ? Do Qimage follow pimpl or copy on write ? e.g. would copying(through copy con or assignment) an Qimage make a deep copy of pixels ?

Upvotes: 2

Views: 1230

Answers (1)

MrFox
MrFox

Reputation: 1254

QImage is copy on write. It will not copy pixels until you start modifying it.

For what it's worth when passing it into functions, I always use const QImage & anyway not to freak anyone out.

Upvotes: 3

Related Questions