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. SVG with effects are rendered as solid color

SVG with effects are rendered as solid color

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 3 Posters 1.3k Views 2 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.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by Mark81
    #1

    I drew a simple SVG with a blur effect. It is correctly rendered in any viewer (i.e. this) but in my Qt5 application it's painted with a solid color. It's a known limitation or I have to set up something:

    Image {
        id: green
        source: "qrc:/items/svg/green-triangle.svg"
    }
    

    ![0_1549532396551_green-triangle.svg](Uploading 100%)

    For some reason the file is not shown... I put it here.

    1 Reply Last reply
    0
    • YunusY Offline
      YunusY Offline
      Yunus
      wrote on last edited by
      #2

      @Mark81 hi. I never used svg before. BUt I'M not sure it is about the type. Did you check these links:

      https://forum.qt.io/topic/75407/qml-svg-files-displayed-incorrectly/2

      https://stackoverflow.com/questions/32242420/qml-doesnt-show-svg-images

      M 1 Reply Last reply
      1
      • YunusY Yunus

        @Mark81 hi. I never used svg before. BUt I'M not sure it is about the type. Did you check these links:

        https://forum.qt.io/topic/75407/qml-svg-files-displayed-incorrectly/2

        https://stackoverflow.com/questions/32242420/qml-doesnt-show-svg-images

        M Offline
        M Offline
        Mark81
        wrote on last edited by
        #3

        @Yunus Actually, the SVG are displayed correctly but for the effects applied (i.e. blur). It seems it's the only thing that is missing.

        1 Reply Last reply
        0
        • YunusY Offline
          YunusY Offline
          Yunus
          wrote on last edited by Yunus
          #4

          @Mark81 Did you add the effects somthing like this:

          FastBlur { //or GaussianBlur
          anchors.fill: green
          source: green
          radius: 25 }

          M 1 Reply Last reply
          0
          • YunusY Yunus

            @Mark81 Did you add the effects somthing like this:

            FastBlur { //or GaussianBlur
            anchors.fill: green
            source: green
            radius: 25 }

            M Offline
            M Offline
            Mark81
            wrote on last edited by
            #5

            @Yunus Please, read again the whole question. The effect is embedded into the SVG. If you want to try, you might download the file with the provided link and test it on any online service (like the one linked). It will show a blurred green triangle. When I show this in the qml application using the code above, it's rendered as a solid green triangle.

            mrjjM 1 Reply Last reply
            0
            • M Mark81

              @Yunus Please, read again the whole question. The effect is embedded into the SVG. If you want to try, you might download the file with the provided link and test it on any online service (like the one linked). It will show a blurred green triangle. When I show this in the qml application using the code above, it's rendered as a solid green triangle.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Mark81
              Hi
              The SVG might contain elements not supported by the Qt SVG render.

              It implements the tiny spec. 1.2
              https://www.w3.org/Graphics/SVG/feature/1.2/#SVG-static

              http://doc.qt.io/qt-5/svgrendering.html

              So i guess the blur effect is not supported.

              1 Reply Last reply
              3

              • Login

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