I creating simple image viewer for education purpose. I have class ScreenImage which including QPixMap for load image. For load image from drive I use QPixMap::load().
class ScreenImage : public QWidget
{
Q_OBJECT
public:
...
bool loadImage(const QString &filename);
QScrollArea *_pScrollArea;
QLabel *_pLabel;
QPixmap *_pPixmap;
...
};
The question: how to delete already loaded into QPixMap image? And if I loaded new image in the same QPixMap then memory for previously loaded image will lost? (will memory leak)?