Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 5.15 concurrent blockingMap does not work with QPixmap::scaled anymore

Qt 5.15 concurrent blockingMap does not work with QPixmap::scaled anymore

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 4 Posters 547 Views
  • 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.
  • MegamouseM Offline
    MegamouseM Offline
    Megamouse
    wrote on last edited by
    #1

    Hi,

    In our code, we use a void blockingMap with a lambda that basically takes a QStringList with image file paths, then loads those images into a QPixmap and scales them with smooth transformation. The result is atomically stored in a queue.

    This was done to improve loading times for the hard refresh of a potentially huge tablewidget with icons.

    The problem now is that starting with Qt 5.15 on my local environment the program will never get past the blockingMap.
    It seems like all the concurrent threads just enter the pixmap.scaled(...) call and never return from that.

    I read on the changelog that some multithreading was added to QImage functions, so I fear that this may be the cause.

    Maybe someone can recreate this?

    Cheers,
    Megamouse

    jsulmJ kshegunovK 2 Replies Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      If you want somebody to help you test your situation, please provide a minimal compilable example that shows the behaviour you currently have.

      You should also state the exact version of 5.15 you are currently using as well as the platform you are having trouble on.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      MegamouseM 1 Reply Last reply
      1
      • MegamouseM Megamouse

        Hi,

        In our code, we use a void blockingMap with a lambda that basically takes a QStringList with image file paths, then loads those images into a QPixmap and scales them with smooth transformation. The result is atomically stored in a queue.

        This was done to improve loading times for the hard refresh of a potentially huge tablewidget with icons.

        The problem now is that starting with Qt 5.15 on my local environment the program will never get past the blockingMap.
        It seems like all the concurrent threads just enter the pixmap.scaled(...) call and never return from that.

        I read on the changelog that some multithreading was added to QImage functions, so I fear that this may be the cause.

        Maybe someone can recreate this?

        Cheers,
        Megamouse

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Megamouse Did you run through debugger to see what happens?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • SGaistS SGaist

          Hi,

          If you want somebody to help you test your situation, please provide a minimal compilable example that shows the behaviour you currently have.

          You should also state the exact version of 5.15 you are currently using as well as the platform you are having trouble on.

          MegamouseM Offline
          MegamouseM Offline
          Megamouse
          wrote on last edited by Megamouse
          #4

          @SGaist

          Windows 10 (10.0.18363 Build 18363)
          Qt 5.15.0 (There isn't any other as far as I can tell)
          i7 7700K

          Sample Project:
          https://drive.google.com/file/d/1NzIiOpMoDZHGOhtpRhjg6wb79Sa4R-L9/view?usp=sharing

          Just use some base_dir with a lot of pictures and the main window will never show.
          This used to work in Qt 5.14.

          1 Reply Last reply
          0
          • MegamouseM Megamouse

            Hi,

            In our code, we use a void blockingMap with a lambda that basically takes a QStringList with image file paths, then loads those images into a QPixmap and scales them with smooth transformation. The result is atomically stored in a queue.

            This was done to improve loading times for the hard refresh of a potentially huge tablewidget with icons.

            The problem now is that starting with Qt 5.15 on my local environment the program will never get past the blockingMap.
            It seems like all the concurrent threads just enter the pixmap.scaled(...) call and never return from that.

            I read on the changelog that some multithreading was added to QImage functions, so I fear that this may be the cause.

            Maybe someone can recreate this?

            Cheers,
            Megamouse

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #5

            @Megamouse said in Qt 5.15 concurrent blockingMap does not work with QPixmap::scaled anymore:

            In our code, we use a void blockingMap with a lambda that basically takes a QStringList with image file paths, then loads those images into a QPixmap and scales them with smooth transformation. The result is atomically stored in a queue.

            QPixmap isn't reentrant, so this was never working, it's just shown its ugly fangs and horns now. Switch to QImage.

            Read and abide by the Qt Code of Conduct

            MegamouseM 1 Reply Last reply
            1
            • kshegunovK kshegunov

              @Megamouse said in Qt 5.15 concurrent blockingMap does not work with QPixmap::scaled anymore:

              In our code, we use a void blockingMap with a lambda that basically takes a QStringList with image file paths, then loads those images into a QPixmap and scales them with smooth transformation. The result is atomically stored in a queue.

              QPixmap isn't reentrant, so this was never working, it's just shown its ugly fangs and horns now. Switch to QImage.

              MegamouseM Offline
              MegamouseM Offline
              Megamouse
              wrote on last edited by
              #6

              @kshegunov said in Qt 5.15 concurrent blockingMap does not work with QPixmap::scaled anymore:

              reentrant

              Hmm, I was already suspecting something similar based on the Qt 5 source code.
              But sadly, using QImage in the sample changes nothing.

              kshegunovK 1 Reply Last reply
              0
              • MegamouseM Megamouse

                @kshegunov said in Qt 5.15 concurrent blockingMap does not work with QPixmap::scaled anymore:

                reentrant

                Hmm, I was already suspecting something similar based on the Qt 5 source code.
                But sadly, using QImage in the sample changes nothing.

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by
                #7

                @Megamouse said in Qt 5.15 concurrent blockingMap does not work with QPixmap::scaled anymore:

                But sadly, using QImage in the sample changes nothing.

                Then it's possible it's an regression. Strip the GUI stuff from the sample code, and please extract a backtrace with debug info, so we can judge where it hangs. I don't have windows Qt 5.15 on hand to test directly, but I'm willing to glance through the backtrace.

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply
                1
                • MegamouseM Offline
                  MegamouseM Offline
                  Megamouse
                  wrote on last edited by Megamouse
                  #8

                  In fact I think it already started to regress with 5.14.2, in case you have that installed.

                  Edit: nevermind, it works still with 5.14.2

                  1 Reply Last reply
                  0
                  • MegamouseM Offline
                    MegamouseM Offline
                    Megamouse
                    wrote on last edited by
                    #9

                    I don't have a proper debugger installed at the moment, so I can't really do much apart from running the code and seeing if it works.

                    1 Reply Last reply
                    0
                    • MegamouseM Offline
                      MegamouseM Offline
                      Megamouse
                      wrote on last edited by
                      #10

                      I was told in the Qt bug tracker that the issue is fixed in Qt 5.15.1.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Can you provide the link to the bug report ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved