SVG graphics appear as solid rectangles in QtCreator and App
-
We have a bunch of icons that were drawn, as vector graphics, in Photoshop.
Since Photoshop's SVG export doesn't work properly, we then open the PSD file in Illustrator instead and export it as SVG from there (all export parameters left on default).Unfortunately, the icons appear as solid-colored rectangles in QtCreator's resource viewer and also in the running app. The symbols look perfectly fine in browsers and other image software like Inkscape.
e.g. This SVG:
shows up in Creator and the app like this:
Does anyone have experience with using SVGs in Qt? Why does this happen?
-
@qwasder85 said in SVG graphics appear as solid rectangles in QtCreator and App:
Can you upload the actual SVG file?
Please note that Qt only supports the static parts of SVG Tiny 1.2; it doesn't support the full SVG standard.
Sure, here it is:
https://drive.google.com/file/d/1S0urW9EeLDd6uNJCNaBRum9K0G4vprYh/view?usp=sharingSVG Tiny 1.2 does not support
<clipPath>
, I'm afraid.Your SVG file is implemented as a solid coloured block with sections clipped/masked away. Since Qt SVG can't do the clipping, it just shows the solid block.
You'll need to find a way to re-implement the SVG file without clipping/masking.
-
@qwasder85 said in SVG graphics appear as solid rectangles in QtCreator and App:
Unfortunately, the icons appear as solid-colored rectangles in QtCreator's resource viewer and also in the running app. The symbols look perfectly fine in browsers and other image software like Inkscape.
Can you upload the actual SVG file?
Please note that Qt only supports the static parts of SVG Tiny 1.2; it doesn't support the full SVG standard.
-
@JKSH said in SVG graphics appear as solid rectangles in QtCreator and App:
@qwasder85 said in SVG graphics appear as solid rectangles in QtCreator and App:
Unfortunately, the icons appear as solid-colored rectangles in QtCreator's resource viewer and also in the running app. The symbols look perfectly fine in browsers and other image software like Inkscape.
Can you upload the actual SVG file?
Please note that Qt only supports the static parts of SVG Tiny 1.2; it doesn't support the full SVG standard.
Sure, here it is:
https://drive.google.com/file/d/1S0urW9EeLDd6uNJCNaBRum9K0G4vprYh/view?usp=sharing -
@qwasder85 said in SVG graphics appear as solid rectangles in QtCreator and App:
Can you upload the actual SVG file?
Please note that Qt only supports the static parts of SVG Tiny 1.2; it doesn't support the full SVG standard.
Sure, here it is:
https://drive.google.com/file/d/1S0urW9EeLDd6uNJCNaBRum9K0G4vprYh/view?usp=sharingSVG Tiny 1.2 does not support
<clipPath>
, I'm afraid.Your SVG file is implemented as a solid coloured block with sections clipped/masked away. Since Qt SVG can't do the clipping, it just shows the solid block.
You'll need to find a way to re-implement the SVG file without clipping/masking.
-
@JKSH said in SVG graphics appear as solid rectangles in QtCreator and App:
@qwasder85 said in SVG graphics appear as solid rectangles in QtCreator and App:
Can you upload the actual SVG file?
Please note that Qt only supports the static parts of SVG Tiny 1.2; it doesn't support the full SVG standard.
Sure, here it is:
https://drive.google.com/file/d/1S0urW9EeLDd6uNJCNaBRum9K0G4vprYh/view?usp=sharingSVG Tiny 1.2 does not support
<clipPath>
, I'm afraid.Your SVG file is implemented as a solid coloured block with sections clipped/masked away. Since Qt SVG can't do the clipping, it just shows the solid block.
You'll need to find a way to re-implement the SVG file without clipping/masking.
Thank you very much! Using Illustrator to save them as Tiny 1.2 SVGs solved the issue, apparently!