QPixmap LoadFromData Not working in Qt 5.6



  • Hello all, please I just migrated from Qt 4.8 to Qt 5.6, but my piece of code that saves an image to a database and retrieves it back into a QByteArray does not load from QPixmap's LoadFromData. Using a Qt 4.8 version of this same piece of code works perfectly, only when I go back to the Qt 5.6 version does it cease to work. I've unbelievably spent days looking for the solution this problem.
    Any help would be appreciated.
    Thanks in advance.
    NB: I haven't posted the code because it's the documented sequence of statements that I have used, which works perfectly for Qt 4.8.
    I'm developing on a Windows 7 machine


  • Qt Champions 2017

    @Automata said:

    LoadFromData

    Hi and welcome.
    You could try this sample for test
    https://wiki.qt.io/How_to_Store_and_Retrieve_Image_on_SQLite
    I ran it here on win 10 , Qt 5.6, mingw and it can use LoadFromData it
    seems. Maybe try with your image and see if it's a format issue
    or maybe it could provide additional info. ?



  • Thanks for your response. I have in fact seen that link you posted and almost every other thing related on the internet before posting here. The problem is really strange to me. Perhaps, it has to do with a corrupted library on my system. I have since downgraded my code to Qt 4.8 in order not to continue loosing time on my development.


  • Qt Champions 2017

    @Automata
    Hi
    So if you run that sample , it fails to read back the image or does it work?
    (in Qt 5.6 for you)



  • It doesn't work at all


  • Qt Champions 2017

    @Automata
    Ok. it does here. also Qt 5.6.

    Could you have other Qt apps installed so other DLL or something like that can be found?
    else I have really no idea how its possible.



  • I'd probe further and post my findings. Thank You


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.