You'll notice from the docs that the QPixmap::scaled
member function is const
- i.e. it doesn't change the object itself.
The scaled object is returned by that method, it doesn't change the original pixmap.
Try something like:
QPixmap bgPixmap(fileName);
QPixmap scaled = bgPixmap.scaled(QSize(64, 64));
QPainter painter(this);
painter.drawPixmap(0, 0, scaled)