Use `QPixmap::scaled` instead of `QPainter::drawPixmap`.
Use
QPixmap::scaledinstead ofQPainter::drawPixmap.