PDA

View Full Version : Does sizeof() operator work with QT Objects?



blue_sky
6th September 2013, 15:26
if I ve an QPixmap Object holding a image file.Does sizeof() work with this object to determine the number of bytes taken by that picture when loaded in memory?
Thank you in advance.

wysota
6th September 2013, 20:57
No. sizeof() returns size of the object, not its data.

anda_skoa
7th September 2013, 09:54
If you want to know the size of an image in bytes you load into a QImage and use its byteCount() method.

Cheers,
_

wysota
8th September 2013, 07:20
If you want to know the size of an image in bytes you load into a QImage and use its byteCount() method.

However the size depends on the image format used and in most cases will be different than what size QPixmap occupies.