Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt 6 replacement for ColorOverlay?
Forum Updated to NodeBB v4.3 + New Features

Qt 6 replacement for ColorOverlay?

Scheduled Pinned Locked Moved Unsolved Qt 6
8 Posts 4 Posters 5.8k Views 1 Watching
  • 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.
  • C Offline
    C Offline
    christofer
    wrote on last edited by
    #1

    Is there a Qt 6 replacement for ColorOverlay?

    I'm upgrading from Qt 5.15 to 6.1. Most of my images are SVG using the ColorOverlay from QtGraphicalEffects. I see that I can use Qt5Compat.GraphicalEffects, but I'm not clear if that is the long term solution or if there is some other way I should be doing color overlay on images in Qt 6.

    This app will only be in Qt 6, so I don't need backwards compatibility to 5.15.

    Thanks!
    -chris

    C 1 Reply Last reply
    0
    • C christofer

      Is there a Qt 6 replacement for ColorOverlay?

      I'm upgrading from Qt 5.15 to 6.1. Most of my images are SVG using the ColorOverlay from QtGraphicalEffects. I see that I can use Qt5Compat.GraphicalEffects, but I'm not clear if that is the long term solution or if there is some other way I should be doing color overlay on images in Qt 6.

      This app will only be in Qt 6, so I don't need backwards compatibility to 5.15.

      Thanks!
      -chris

      C Offline
      C Offline
      christofer
      wrote on last edited by christofer
      #2

      @christofer Side note...

      I was getting console messages like this...

      Texture 0x71f12c0f14440 () used with different accesses within the same pass, this is not allowed.
      

      The messages stop if I cache each ColorOverlay. This isn't a problem, as far as I can tell, because none of my images are animated. But I don't know if it's expected.

      Example that doesn't get the message...

      Image {
         source: "/images/my-image.svg"
         width: 30
         height: 30
         ColorOverlay {
            color: "#99FF99"
            anchors.fill: parent
            source: parent
            cached: true
         }
      }
      

      Example that does get the message...

      Image {
         source: "/images/my-image.svg"
         width: 30
         height: 30
         ColorOverlay {
            color: "#99FF99"
            anchors.fill: parent
            source: parent
            //cached: true
         }
      }
      
      1 Reply Last reply
      0
      • jeremy_kJ Offline
        jeremy_kJ Offline
        jeremy_k
        wrote on last edited by
        #3

        The example in the documentation shows the ColorOverlay as a sibling of the Image, with the Image's visible set to false. Perhaps putting a ColorOverlay inside an Image results in one of them being traversed twice.

        Asking a question about code? http://eel.is/iso-c++/testcase/

        C 1 Reply Last reply
        1
        • jeremy_kJ jeremy_k

          The example in the documentation shows the ColorOverlay as a sibling of the Image, with the Image's visible set to false. Perhaps putting a ColorOverlay inside an Image results in one of them being traversed twice.

          C Offline
          C Offline
          christofer
          wrote on last edited by christofer
          #4

          @jeremy_k Thanks Jeremy! Making ColorOverlay a sibling works without having to cache.

          I'm leaving the thread "unresolved" because my original question is about whether we should be using something other that qt5compat with Qt6 for the long run.

          Example that works without cache...

          Image {
             id: theImage
             source: "/images/my-image.svg"
             width: 30
             height: 30
          }
          ColorOverlay {
             color: "#99FF99"
             anchors.fill: theImage
             source: theImage
          }
          

          update: Using ColorOverlay as sibling worked everywhere except in a Row. The layout of the Row got collapsed. cached: true works for my particular case in the Row but it still seems buggy.

          VRoninV 1 Reply Last reply
          0
          • C christofer

            @jeremy_k Thanks Jeremy! Making ColorOverlay a sibling works without having to cache.

            I'm leaving the thread "unresolved" because my original question is about whether we should be using something other that qt5compat with Qt6 for the long run.

            Example that works without cache...

            Image {
               id: theImage
               source: "/images/my-image.svg"
               width: 30
               height: 30
            }
            ColorOverlay {
               color: "#99FF99"
               anchors.fill: theImage
               source: theImage
            }
            

            update: Using ColorOverlay as sibling worked everywhere except in a Row. The layout of the Row got collapsed. cached: true works for my particular case in the Row but it still seems buggy.

            VRoninV Offline
            VRoninV Offline
            VRonin
            wrote on last edited by VRonin
            #5

            @christofer said in Qt 6 replacement for ColorOverlay?:

            whether we should be using something other that qt5compat with Qt6 for the long run.

            https://bugreports.qt.io/browse/QTBUG-85256
            https://bugreports.qt.io/browse/QTBUG-78572

            ColorOverlay was ported so you can use the BSD licensed repo in Qt6

            "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
            ~Napoleon Bonaparte

            On a crusade to banish setIndexWidget() from the holy land of Qt

            C 1 Reply Last reply
            0
            • VRoninV VRonin

              @christofer said in Qt 6 replacement for ColorOverlay?:

              whether we should be using something other that qt5compat with Qt6 for the long run.

              https://bugreports.qt.io/browse/QTBUG-85256
              https://bugreports.qt.io/browse/QTBUG-78572

              ColorOverlay was ported so you can use the BSD licensed repo in Qt6

              C Offline
              C Offline
              christofer
              wrote on last edited by
              #6

              @VRonin Thanks for the links :)

              C 1 Reply Last reply
              0
              • C christofer

                @VRonin Thanks for the links :)

                C Offline
                C Offline
                christofer
                wrote on last edited by
                #7

                Based on the links @VRonin gave, it seems like we're supposed to still use ColorOverlay. But I'm leaving this thread unresolved because It still seems buggy or maybe I'm just not using it right.

                I've been able to get all my SVG looking right without warnings using the tips above ... except for one that is animated.

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  David K. Hess
                  wrote on last edited by
                  #8

                  Adding this bug report to the conversation: https://bugreports.qt.io/browse/QTBUG-88645

                  It appears GraphicalEffects is intended to be replaced by something like MultiEffect - which isn't ready for Qt 6 yet.

                  1 Reply Last reply
                  0
                  • C christofer referenced this topic on

                  • Login

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