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. Problem with transparent background using Inkscape SVG icons in Qt
Forum Updated to NodeBB v4.3 + New Features

Problem with transparent background using Inkscape SVG icons in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 139 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.
  • B Offline
    B Offline
    buhtz
    wrote last edited by
    #1

    X-Post on reddit r/Inkscape

    Hello,

    I have a logo in SVG format (left in this picture) created with Inkscape. I can confirm that the background in the original file ins transparent. The background works fine when using this icon for a desktop shortcut in XFCE (a GNU/Linux desktop environment).

    But when using that file as an icon in a Qt (Python with PyQt6) application the background is black. So it seems to be that Qt is the cause. But as you can see on that picture other SVG icons (xarchiver.svg) with transparent background working fine.

    81ca2331-b6db-421c-af87-df2ebb231491-image.png

    So I am assuming that Qt is not very tallented in interpreting SVG files. But an SVG file can be constructed in a way that even Qt can use it.

    Does anyone of you have experience with that and know what to do with such an SVG file to make it proper for being used in Qt applications?

    Checking the SVG source of xarchiver.svg it seems even this was created with Inkscape (~19 years ago).

    I am aware of several in code manipulations to allow make the background transparent after importing the SVG file into Qt. But this are workarounds only. I would prefer to have a proper SVG file that can be handled by Qt without manipulating it. The xarchiver logo proofs that it must somehow be possible to create an SVG logo that can be handled by Qt.

    Regards,
    Christian

    jsulmJ 1 Reply Last reply
    0
    • B buhtz

      X-Post on reddit r/Inkscape

      Hello,

      I have a logo in SVG format (left in this picture) created with Inkscape. I can confirm that the background in the original file ins transparent. The background works fine when using this icon for a desktop shortcut in XFCE (a GNU/Linux desktop environment).

      But when using that file as an icon in a Qt (Python with PyQt6) application the background is black. So it seems to be that Qt is the cause. But as you can see on that picture other SVG icons (xarchiver.svg) with transparent background working fine.

      81ca2331-b6db-421c-af87-df2ebb231491-image.png

      So I am assuming that Qt is not very tallented in interpreting SVG files. But an SVG file can be constructed in a way that even Qt can use it.

      Does anyone of you have experience with that and know what to do with such an SVG file to make it proper for being used in Qt applications?

      Checking the SVG source of xarchiver.svg it seems even this was created with Inkscape (~19 years ago).

      I am aware of several in code manipulations to allow make the background transparent after importing the SVG file into Qt. But this are workarounds only. I would prefer to have a proper SVG file that can be handled by Qt without manipulating it. The xarchiver logo proofs that it must somehow be possible to create an SVG logo that can be handled by Qt.

      Regards,
      Christian

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote last edited by
      #2

      @buhtz You can see here what is supported by Qt: https://doc.qt.io/qt-6/svgextensions.html

      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