Skip to content Skip to sidebar Skip to footer

Integration Of Svg And Javascript In Qt Application

I have seen that Qt integrates svg and also integrates javascript, but I have not found a way to execute the JavaScript embedded in a .svg Does anyone know how to join these two fu

Solution 1:

You need to use QtWebKit to display your SVG file instead. Its SVG implementation can use the WebKit JavaScript engine. QtSvg cannot.

The simplest way is to create a QWebView widget. If you just want to verify that this works, compile the "fancybrowser" example included with the Qt source. I confirmed that "fancybrowser" can execute the inline JavaScript in an example SVG file from Matthew Bystedt's blog, using Qt 5.0.0 on Windows. I would guess that Qt 4.8.4 also supports it, but I haven't tried that myself.


Post a Comment for "Integration Of Svg And Javascript In Qt Application"