[Qt-interest] Qt memory management.

Ramesh ramesh.bs at robosoftin.com
Wed Aug 18 11:15:19 CEST 2010


Hi,

today i found this link

 

http://doc.trolltech.com/4.5/shared.html

 

in the list of class section i found,

 

QPixmap p1, p2;

p1.load("image.bmp");

p2 = p1;                        // p1 and p2 share data

 

 QPainter paint;

 paint.begin(&p2);               // cuts p2 loose from p1

 paint.drawText(0,50, "Hi");

 paint.end();

 

Qt widgets uses shared memory so  we can't copy a widget to another widget
right? 

 

But in this case 

p2 = p1;

both are Qpixmap object, and Qpixmap is not inherited from Qobject so
assigning a pixamp to another leads to copy operation right?.

 

 

 


-----------------------------------------------
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100818/587f86d9/attachment.html 


More information about the Qt-interest-old mailing list