Load SVG image with parameters
Unsolved
QML and Qt Quick
-
Hello experts of Qt/QML.
I have some svg images, example from w3.org:<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 110 40" width="100%" height="100%"> <title>Reusable Button</title> <desc>Takes parameters from parent document's embedding element.</desc> <defs> <ref id="paramFill" param="color" default="blue"/> <ref id="paramText" param="text-label">button</ref> <ref id="paramStroke" param="outline" default="navy"/> </defs> <g> <rect id="button_rect" x="5" y="5" width="100" height="30" rx="15" ry="15" fill="url(#paramFill)" stroke="url(#paramStroke)" /> <text id="button_label" x="55" y="30" text-anchor="middle" font-size="25" fill="black" font-family="Verdana"> <tref xlink:href="#paramText" /> </text> </g> </svg>
And i want to know how (if it's possible) to pass the parameters value from qml Image:
I tried the classic way (web) to do that by url and using qml property on the image but it's not working.Image{ anchors.fill: parent property string paramFill: "red" property string paramStroke: "blue" source:"qrc:/img.svg?paramFill=red¶mStroke=blue" }
If anyone can help to achieve this it will save me a lot of hours.
Thanks by advance and sorry for my bad english