PDA

View Full Version : Interactive Animation in SVG Not Working



Jick
3rd February 2010, 13:14
I'm developing an app in Qt for the very first time. I'm also very new to C++ in general. I have a background in web technologies like PHP, MySQL, HTML, CSS, etc. I think I have the basics down but I'm running into a little problem displaying an interactive animated SVG.

More specifically, the animation doesn't seem to be working. It displays the SVG just fine, but just statically. The animation doesn't work at all.

I have attached a very dumbed-down version of my app which is having the issue. I tried loading in the bubbles.svg file from the SVG Viewer example here (http://doc.trolltech.com/4.6/painting-svgviewer.html) instead of my SVG and the animation worked in that. Also, I've tried doing just a basic animation in my SVG file in case its the mouseover/mouseout that it doesn't like. However, I couldn't seem to get a basic animation to work either. So, I don't think its a bug in Qt or anything. It must be a problem with my SVG I guess.

One other thing to note is this same SVG file works perfectly in my web browsers.

I would really appreciate it if someone could shine some light on this problem.

Thank you. :)

axeljaeger
6th February 2010, 10:07
On my system, I see a plus button that does nothing and the animated bubbles from the Qt example when compiling your application. Is that the expected behavior?

Jick
6th February 2010, 16:18
Afraid not. What's supposed to happen is when you hover over the plus button it is supposed to crossfade until the button becomes blue with a blue glow around it. As I said, it works just fine if you test it in a web browser like Safari.

axeljaeger
6th February 2010, 22:28
I tried both graphics with safari: The Qt logo is rotating but the bubbles are not moving. Your button works fine.

In the demo application, I see moving bubbles, a rotating Qt logo but your button is not working.

Maybe mouse move events are not supported in the Qt widget. But you can try to embed a QWebView to have the full webkit implementation for showing the SVG.