Qt 显示图片
QImage qImag("img.jpg");
//qImag = qImag.scaled(width, height); //缩放图片
qImag = qImag.scaled(ui.label_img->size());
ui.label_img->setPixmap(QPixmap::fromImage(qImag));
QFile file("img.jpg");
file.open(QIODevice::ReadOnly);
QByteArray t = file.readAll();
QImage qImag;
qImag.loadFromData(t, "jpg");
qImag = qImag.scaled(ui.label_img->size());
ui.label_img->setPixmap(QPixmap::fromImage(qImag));
file.close();