//Base64编码转图片
//lBase64Str是存放base64编码的QString
QSize picSize(600,400);
//lBase64是存放Base64编码的QJsonObject对象
QString lBase64Str = lBase64["PictureBase64"].toString();
gBase64Image.loadFromData(QByteArray::fromBase64(lBase64Str.toLatin1()));
QPixmap scaledPixmap = gBase64Image.scaled(picSize, Qt::KeepAspectRatio);
//Base64MapLable是QLable控件
Base64MapLable->setPixmap(scaledPixmap);
以上为Base64转图片(QPixmap)再用QLable显示图片的代码。