int w = ui->photo->width(); int h = ui->photo->height(); imagefile.scaled(w, h, Qt::KeepAspectRatio); ui->photo->setPixmap(imagefile);
C++ (Qt)...imagefile = imagefile.scaled(w, h, Qt::KeepAspectRatio);...
C++ (Qt)QLabel::setScaledContents( true );