Unsolved Problem for displaying SVG image
-
hey ! I would like to display an SVG image on my HMI (I use a Gridlayout for now)
Here is what I do :
#include <QSvgWidget> #include <QtSvg> ... QSvgWidget *svg_pic = new QSvgWidget("image's adress"); layout->addWidget(*svg_pic,19,5,2,2);
Also I put QT += svg in my .pro
On my HMI I only obtain a black square on the position of the image.. I dont know why
Thans for help :)
-
Qt only supports SVG tiny specification. Not all SVG images will work. I suggest checking it out in a simple desktop (Qt) app, to verify whether your image is OK.
-
@Chanchan said in Problem for displaying SVG image:
QSvgWidget("image's adress")
What is "image's adress" here and are you sure it is valid (can be found)?
-
@sierdzio Oh I see, then I check it with an example from the documentation I guess ?
@jsulm Yeah I am sure , I mean , this image is on my desk, I simply copy/past the way of the folder.img_name. Also, I tried to modify it just to see if the program will return me an error and that the case. So I guess it's okey on this side
-
Hi
you could also post a link to the SVG here so we could check it out. -
okey :
home/clement/Bureau/Icon_partner
-
@Chanchan said in Problem for displaying SVG image:
Icon_partner
hi
that wont work :)
something like
https://postimages.org/and just post link here
-
Hey, I think I wasn't clear enough so that's my bad ^^
The picture I want to display is not from the web, this is a picture that I did myself with a svg extension. So It is stocked on my own computer (on my desktop) -
But I can send you the image if you want to test it :)
-
@Chanchan said in Problem for displaying SVG image:
But I can send you the image if you want to test it :)
Yes, that's what @mrjj is trying to get from you.
-
Hi
on https://postimages.org/
you can just press upload and point to the image on your harddrive
and you get a link you can post here. -
Oh okey... sorry It is the morning x) I have some dofficulties to wake up
The extension was not recognize by your site @mrjj , I use wetransfer, here is the link to download ;)
https://we.tl/t-vtIuH5rzjnAgain thank you very much for helping me
-
@Chanchan
Hi
hehe np. i know that feeling.
I also got black rect. Something Qt didnt like.
However after fiddling a bit in inkscape and saved it again. it would show.here is modified svg. please try that.
https://www.dropbox.com/s/kk7j4t9p9h06ce6/Icones_Partner_v7.3_Administration.svg?dl=0