Thanks,
I also tried this but doesn't work:
QFile file("/home/user/cat.png");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return QImage();
QByteArray content = file.readAll();
QImage::fromData(content.toBase64(QByteArray::Base64Encoding), "PNG");