QPixmap not getting resized with scaled()
hai, i am resizing the image with scaled function, but it is beeing with the ame size only. i want to decrese size of the image, so that they will take less memory.
i am displaying 1000 images on scene so it is taking more memory because of ths issue. how i have to reduce the sie of Qimage and display them on scene as a thumbnile .
Code:
QImage image
= tempImage;
// is 1025*724 image.scaled(50,50,Qt::KeepAspectRatio);
scene->addItem(item);
after scaling it still the image size is same as old temp image size only.
Re: QPixmap not getting resized with scaled()
Check the signature of QPixmap::scaled
Its a const method i.e. it will not change the object state. What you need is this :-
.
.
image = image.scaled(50,50,Qt::KeepAspectRatio);
.
.