How to get a picture from QString in Qt
Solved
General and Desktop
-
@mikeeeeee do you actually want a qbytearray as a value to a key inside your son file ?
-
So it turns QString into a picture to translate
QString AppCore::getImage(QString addressFile) { QImage myImage(addressFile); QByteArray bArray; QBuffer buffer(&bArray); buffer.open(QIODevice::WriteOnly); myImage.save(&buffer, "JPEG"); QString image("data:image/jpg;base64,"); image.append(QString::fromLatin1(bArray.toBase64().data())); QImage testImage(image); qDebug()<<"myImage.size() : "<<myImage.size(); return image; }