svg animations in qt 4.8.6



  • Hello

    We are trying to use animated svg files in a project using qt 4.8.6 using QSvgRenderer. It appears that animations such as

    <animateTransform attributeName="transform" type="scale" values="1;0.85;1" begin="0s" dur="0.8s" fill="freeze" repeatCount="indefinite" />
    

    work as expected when compiled. However, animations like

    <animate attributeName="opacity" values="0;1;0" begin="0s" dur="0.8s" fill="freeze" repeatCount="indefinite" />
    

    works fine in chrome, but does not work via Qt. I have found only one reference to this problem, but no solution. Is there one?

    Thank you


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What reference was it ?




  • Lifetime Qt Champion

    From a quick look at the sources, the animate node are not parsed. However, Qt's officially supports the static features for SVG Tiny 1.2 so I don't know whether animate not falls in this case.



  • Which files are you looking at regarding the parsing?

    Thanks


  • Lifetime Qt Champion



  • Thanks for the help. Seems like a big omission to leave out animate which holds opacity, but never mind.


  • Lifetime Qt Champion

    I don't know what it would take to implement that. Do you have an example of a simple SVG that has that animation ?



  • This is a simple one that uses hover

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="34px" height="34px" viewBox="0 0 34 34" xml:space="preserve">
    	<image width="34" height="34" opacity="1" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABNRJREFUeNrsWElLbEcUPu08tbM4PMeFLxAxiGCI0BBUgpvgSkmy8mXTImSRTTZvI/kPgcZVsgo2vAgRkk0IGJQYIogEVAwOJHHEoZ3nId9X9Gmqr32vbVYucuBwvVW3zvnqqzNU67u/v5fnICnyTOTZAEmzX6qqqpJZ0wD9CPoBtADaEh2fhR5Cf4KGNzY2Vt0M+Hw+87TDw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WluTi4iJ2tm50s+uur68bpSPnUWjgXl5eStQm2VhL6mIEVmaxi08XFhZMk7LbufN+6jWmDY8xNzc3R8a+RAz+6mTD884KMN8gsj+Zn5839w4WIe28j4l2ab2zEASK4WswNoLpf5K6xbMO2ILfLe/imy/QMXt5T+FvGb0sa8XUY7CvCGSB10wA+Z7HASZ+x2cr+P7mPwGJOvEhKD8HgFfIlHdYZXNycgyYaAMz9xcCYHqy8AHIH8wOsPAjpnehf997NKgHQLwE907cp/0B/DT4ECDeA7486MtofPwJPQEjvyEWfkZssYSfQtehx48VxScBsQBl4VEE9bOkQHOiUwzC26jjCI71wmW9N5D//y0B+VeAAQBSLcVa3zwajAAAAABJRU5ErkJggg==">
    		<animate attributeName="opacity" to="0" dur="300ms" begin="theTop.mouseover" fill="freeze"/>
    		<animate attributeName="opacity" to="1" dur="300ms" begin="theTop.mouseout" fill="freeze"/>
    	</image>
    
    	<image width="34" height="34" opacity="0" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACJ5JREFUeNqcWGlsXFcVPm+ZffU23uLEcZzES9MGnDppUNNASH+xtaCCRBFIoBYJCSr1B38o4gc/EYIKUbUIVCRKI6hESSsFlFZtajVNSty0SR27Xho76dixPeNlNs/y5g3fmXee59lxk8CTPt2Z++4957vnnnvOuU+hgcfoTp6Bx55V0KiAS+AGdOnjxwQMoAiUBObwc49XtpB1k3z9DgioMs4LBIEIEJbfXocMJpEHMkAKWAWymL/G70DIvJUepWqR4eduJvBsRRElfiAKxIAWoFV+1wMhsQyJJdLAErAAzAHzghUgVyX0uFLZisiWFgEJtoJHCLQBnUA3sGNtKb57aeJ8d/rGRKNZyuv55RtsFfLWteRVl9cItexO1O8+OOmrb59A9wwwBVwFZpkQZBdAxrytRYSET1a9C+gHehevvHk4Of5Ol9tdDBx85AgNfnYPRfxu6mlrrM4bm03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OyNCj10XVKTZ0HKa3orz+e8HXcO+Xy5j9ovPe+VxRNn7ijC9anXDnb7StnPrnSu3Tx0v7MtTPtxczloGnmtFIuVbWqyx82VNVfdgf3Zbz1g4taJLqgqtmZYEfzUKir/yKGxGU77uzKucUlPLD5El5cXd2+Np/sLKYLTYiabiNX8KCAKaseZRnVz6or4Jr2t7aM+Fo67SsmE8j+z5dw22c44oFQSk7Usqwq7I5EGHZR45IppU2fJVLye00I3PKzxG2/j4iAIgjZ2TIp5aX9wcb5ocb+QFNc/1DzKRbY/PxXgAEAO2cfxHJv77oAAAAASUVORK5CYII=">
    		<animate attributeName="opacity" to="1" dur="300ms" begin="theTop.mouseover" fill="freeze"/>
    		<animate attributeName="opacity" to="0" dur="300ms" begin="theTop.mouseout" fill="freeze"/>
    	</image>
    
    	<circle id="theTop" fill="#000000" opacity="0" cx="16.917" cy="16.917" r="14"/>
    </svg>
    

    kind regards


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.