Qt: resizing a QLabel containing a QPixmap while keeping its aspect ratio
In order to change the label size you can select an appropriate size policy for the label like expanding or minimum expanding. You can scale the pixmap by keeping its aspect ratio every time it changes: QPixmap p; // load pixmap // get label dimensions int w = label->width(); int h = label->height(); // set … Read more