Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt 6.8 - VectorImage and color/colorization issues (with MultiEffect)
Forum Updated to NodeBB v4.3 + New Features

Qt 6.8 - VectorImage and color/colorization issues (with MultiEffect)

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 304 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.
  • nicwainwrightN Offline
    nicwainwrightN Offline
    nicwainwright
    wrote on last edited by nicwainwright
    #1

    EDIT: Solved - in thread comment #2

    Original Post: So using Qt6.8, I've replaced my IconImage usage with VectorImage since I use many small SVG files in my application. I've thus become unable to use "color" since VectorImage doesn't support/extend this.

    I've since begun using MultiEffect, but WITH issues (screenshot further down)

    Code for minimal:

    Item {
    id: root
    color: <input from higher level>
    source: <input from higher>
        VectorImage {
            id: mySVG
            width: root.desired_width
            source: root.source
            anchors.centerIn: parent
            preferredRendererType: VectorImage.CurveRenderer
            fillMode: Image.PreserveAspectFit
        }
        MultiEffect {
              id: colorOverlay
              source: mySVG
              anchors.fill: mySVG
              colorization: 1.0 // opacity equivalent
              colorizationColor: root.color
        }
    }
    

    Here's the issue: I get a tiny WHITE line around the outside of my "non-white" implementations of this Item
    35fa81a6-f4f7-4d3f-87ab-c48701e85ef0-image.png

    How can I go about improving this? Anyone had luck with the new VectorImage and color?

    1 Reply Last reply
    0
    • nicwainwrightN Offline
      nicwainwrightN Offline
      nicwainwright
      wrote on last edited by nicwainwright
      #2

      SOLVED thanks to a previous forum post regarding using MultiEffect on Image{} type component

      All that's required is to set VectorImage's visible to false, since the compositor seems to be double rendering, I suppose, creating the unwanted outline of the SVG

      Thanks to 6.5 article: https://forum.qt.io/topic/144070/qt6-color-svg-using-multieffect/3
      and member: https://forum.qt.io/user/mzimmers

      New graphics:
      3f636858-1079-499b-9803-afcd8b926c3c-image.png

      WORKING CODE:

      Item {
      id: root
      color: <input from higher level>
      source: <input from higher>
          VectorImage {
              id: mySVG
              ~~~~ same lines from above ~~~~~
              visible: false <======== DONT FORGET THIS
          }
          MultiEffect {
                id: colorOverlay
                source: mySVG
                anchors.fill: mySVG
                colorization: 1.0 // opacity equivalent
                colorizationColor: root.color
          }
      }
      
      1 Reply Last reply
      2
      • nicwainwrightN nicwainwright has marked this topic as solved on

      • Login

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