Priority: P3: Somewhat important
Affects Version/s: 4.7.0
Fix Version/s: None
Component/s: Qt SVG
Win XP SP3
I have a SVG which uses a CSS file. I find if some SVG style attributes are split between CSS and SVG, the QSvgRenderer does not handle it correctly.
Take this SVG element
<rect width="50" height="30" fill-opacity="0.5" class="myfill">
and the CSS that defines the fill attribute is
So, I should get a 0.5 opacity red rectangle in my SVG. This works fine in various browsers like Chrome and Firefox, but when I use Qt SVG module to render this, it does not work properly.
I ran through the code and find that the switch case for handling CSS elements searches for the starting letter of the element and the whole logic is based on that. So when fill and fill-opacity are split between the SVG and CSS, this does not work. But if I have both fill and fill-opacity in the same place (either both in the SVG or both in the CSS), then the Qt SVG renderer shows the rectangle correctly! I think this approach of parsing the CSS is not the best way to do it.
|Field||Original Value||New Value|
|Priority||Not Evaluated [ 6 ]||P3: Somewhat important [ 4 ]|
|Status||Reported [ 10011 ]||Open [ 1 ]|
|Status||Open [ 1 ]||Reported [ 10011 ]|
|Assignee||Kim Motoyoshi Kalland [ kkalland ]|
|Workflow||Qt Bug Tracking [ 261396 ]||Qt Bug Tracking v2.0 [ 307996 ]|