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 ?
            Asked
            
        
        
            Active
            
        
            Viewed 1,163 times
        
    2
            
            
        1 Answers
3
            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.
        MrFox
        
- 1,244
 - 1
 - 11
 - 24
 
- 
                    2A reference to documentation that proves your statement would be highly desirable. – liori Sep 03 '14 at 23:58
 - 
                    Late to the party, but [here](https://doc.qt.io/qt-5/qimage.html#details) you can read that `QImage` uses implicit data sharing. – Adversus Mar 12 '21 at 14:24