Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QPixmap LoadFromData Not working in Qt 5.6

    General and Desktop
    2
    7
    1528
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Automata
      Automata last edited by

      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

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by mrjj

        @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. ?

        1 Reply Last reply Reply Quote 0
        • Automata
          Automata last edited by

          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.

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @Automata last edited by

            @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)

            1 Reply Last reply Reply Quote 0
            • Automata
              Automata last edited by

              It doesn't work at all

              mrjj 1 Reply Last reply Reply Quote 1
              • mrjj
                mrjj Lifetime Qt Champion @Automata last edited by

                @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.

                1 Reply Last reply Reply Quote 0
                • Automata
                  Automata last edited by

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

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post