i tried the same but it didnt worked.
i tried the same but it didnt worked.
it works fine for me. what did you try?
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
i am doing it following way..
say have an image file named: apple.png
i opened the file and read it completely using file.readAll(). and saved it into QString (str).
then i converted this QString(str) into QbyteArray and then called toBase64(). and then tried to save it in database and in same way i tried to read it from database but it didnt worked.
Can you share your sample code for this?
thanx
why are you saving data to QString and then converting it to QByteArray? isn't readAll() alredy returning QByteArray? try to readAll() straight into QByteArray without any QStirings
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
its not working for me![]()
can you show us your code?
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
Save given QImage directly into QByteArray:
(Taken from Documentation)Qt Code:
QImage image; QByteArray ba; image.save(&buffer, "PNG");To copy to clipboard, switch view to plain text mode
Bookmarks