1

I'm testing the SVG Viewer, located in QT Examples and Example, and all SVG I tried doesnt show properly.

Is SVG fully suported in QT, or does it need extra work?

In SVG Viewer most of the elements are not shown.

I also tried QSvgWidget and results are even worse than thoose from SVG Viewer.

Finchsize
  • 935
  • 2
  • 17
  • 34
  • Did you test those files in your browser? Svg is supported and should work fine, if used correctly. See http://doc.qt.io/qt-5/qtsvg-index.html – Felix Nov 09 '15 at 19:50
  • Yup i test it in browsers. They are fine. The files are rendering in my qt app, but they are messed up. Its looks like qt dont support new svg standards, only the basics. – Finchsize Nov 09 '15 at 20:27
  • 3
    Qt's SVG generally works fine, but I've definitely seen bugs where it renders differently in Inkscape, Firefox, etc. – MrEricSir Nov 09 '15 at 22:00
  • Ok. i found what i was looking for. My SVG uses elements wich are outside of the spec for SVG Tiny 1.2. And Qt svg does not support it. – Finchsize Nov 10 '15 at 15:53
  • Exactly: http://doc.qt.io/qt-5/svgrendering.html – mlvljr Jun 17 '16 at 23:09

1 Answers1

0

Qt aslo suport svg in

  Image {source:'someinage.svg'}

you need to do what is said in link what felix posted in coments

i got it reasonably working with inkscape(exporing it to "plain svg" incspace) especialy when i tweeked manualy parameter

viewBox

to

viewbox="0 0 <width> <height>" 
// <width> and <height> was multiple of widhth and height of image in qml
// you must obyde ration of <width> and <height>
//i recomend higher  resolution qt can not scale svg properly up

still it had problems with gradients

gussPepe
  • 13
  • 1
  • 5