Qt Animation Framework 2.3 is out

Published Thursday April 23rd, 2009
13 Comments on Qt Animation Framework 2.3 is out
Posted in Graphics, Kinetic

Since I don’t want to take focus away from the 4.5.1 release, I’ll keep this short. We have now released an updated version of the Animation Framework solution. There are not so many visible changes to the animation classes – besides bug fixes we renamed QAbstractAnimation::iterationCount back to QAbstractAnimation::loopCount. (You don’t want to know how many times we have discussed the naming of that property). And let’s not forget that sub-attaq now has animated explosions! (sorry, no video)
But there are more interesting changes to the state machine classes. Hopefully, this will be the last solution before it gets merged into 4.6 so this might be one of your last chances of influencing it.

Please tell us what you think!

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in Graphics, Kinetic

13 comments

Robert K. says:

Looking good but I’ve run into some issues.

I’m using MSVC++ 2008 on Vista. Downloaded open source version, unpacked, ran VS2008 Command Prompt, ‘configure’ doesnt really do much.
It created .licenseAccepted and well nothing else. No makefile, nothing. nmake of course doesnt work because of that.

Gonna try compiling from .pro but I guess it’s not expected behaviour.

alexis.menard says:

@Robert K. : On my machine MSVC++ 2008 so same as you. I run configure.bat and i get :

“This component is now configured.
.
To build the component library (if requested) and example(s),
run qmake and your make or nmake command.”

So run qmake and then nmake and it is just works :D. Please read what the configure.bat say. configure.bat just check if you accept the license. So this is the expected behavior.

Robert K. says:

@alexis.menard :
Ahh my bad. I forgot about running qmake (dumb me). Now of course it works. Oh and compiling from .pro works too of course. Great framework!

David says:

I downloaded and ran your animations examples. I found the sub-attack game taking almost 20% of my CPU. Outrageous I first thought, but then I checked out a similar kind of flash animation game (squid hunter) and found that with firefox they were taking more then 80 % of my cpu cycles to animate about the same amount of pixmaps.

As animation goes, Qt seems to be fairly light, and I hope it gets even lighter as the code base matures.

On another note. I think there are two types of animations. the first being for games and monitor displays that show dynamic states (factory floors, gauges, etc) . Developer’ s for these kind of applications will very much appreciate your heavy animation APII. The second group is for more traditional applications where animation is used in subtle ways to show changes in state and provide user feed back. Please pay attention to this second group as they wont want to use a 20 lb hammer to drive thumb tack in.

Thank you for the updates.
David Boosalis

Vitaly says:

Any thoughts on why the sub-attaq example may not compile? (compiler gives a bunch of errors, 400+) All other examples compile just fine.

alexis.menard says:

@Vitaly : As we don’t have a crystal ball to read in your mind, what is your OS, Qt Version, Compiler? It works fine with MSVC 2008, GCC, and Mac g++

Zark says:

@Alexis

I guess I have similar issue as Vitality. Windows XP , QT 2009.01 SDK, Mingw. It is exact the same issue as discussed in the previous animation fwk update: http://labs.trolltech.com/blogs/2009/03/27/new-and-last-qtanimationframework-solution/ by e.g. Brett .

There is something funky at the generated makefiles as INCPATH doesn’t get and e.g. Qtcore/qobject.h can’t be found.
###
mingw32-make[3]: Entering directory `H:/Qt/qtanimationframework-2.3-opensource/e
xamples/sub-attaq’
g++ -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT
_EXPERIMENTAL_SOLUTION -DQT_STATEMACHINE_SOLUTION -DQ_ANIMATION_EXPORT= -DQT_DLL
-DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQ
T_NEEDS_QMAIN ../../src/qtstate.cpp -o ../../src/QtState
In file included from ../../src/qtactionstate.h:55,
from ../../src/qtstate.h:55,
from ../../src/qtstate.cpp:49:
../../src/qtabstractstate.h:52:28: QtCore/qobject.h: No such file or directory
###

Other examples compile fine (some issues when run though: stickman doesn’t react to any keypresses).

Vitaly says:

@alexis.menard
Right. Sorry. Here goes:
OS: Vista x64
Qt SDK 2009.02 (open source)

In QtCreator “#include ” in “qtstate.h” is underlined and the hint says “No such file or directory”
I wonder where/how should I specify the path to the Qt State Machine solution (which is installed) in the project options?

@Zark Same here. Stickman doesn’t move no matter what I press.

Jan-Arve says:

@Zark, Vitaly: It sounds like you don’t have added the include path to the animation framework to your project file. Try to include the qtanimationframework.pri from your project file. That should set up the correct include paths.

Zark says:

@Jan-Arve

The compilation problems are not with my own project, but with the sub-attaq example that come with qtanimationframework. It just doesn’t compile in Windows XP & mingw (and sub-attaq has “include(../../src/qtanimationframework.pri)” ).

Thierry says:

@Zark: indeed I could reproduce the problem you’re describing. We’ll investigate that. Thanks for the report.

Scorp1us says:

I tried to use this, and it works, but the performance seems to degrade fast.

I have 35 animations in a parallel animation. These were all pauses of increasing length (1s, 2s, 3s, etc) then kick off their real animation. Each animation would run so that by the time the next started all items from the previous animation would be off-screen (zero alpha). The problem with this is it was way too jerky. We’re talking a draw update every 0.5-1.0 seconds. I changed it to have the current animation start the next, and removed the 33 unneeded animations and it is smooth again. Well, not exactly.

The QGraphicsTextItem isn’t smooth scaling. Nor is SVG. And if you render it as Pixmap, you either have to down sample, or you get pixelation. As it turns out, you need to use QPainterPaths to make nice scaling text. Fortunately it is not hard:

AffineTextItem::AffineTextItem(const QString &text, const QFont &font, const QColor &color)
:_text(text), _font(font), _color(color), _fm(font)
{
_path.addText(0, _fm.ascent(), _font, _text);
_br = _fm.boundingRect(_text).adjusted(0,0,0, _fm.ascent());
}

QRectF AffineTextItem::boundingRect () const { return _br; }

void AffineTextItem::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget )
{
if (opacity() == 0)
return;
painter->fillPath(_path, _color);
}

But it is annoying. Maybe add an GraphicsAffineTextItem to Qt? This will be a problem as people try to animate text.

newbie says:

Hello

I am trying to build dll file.
i have run configure -library then qmake, after that mingw32-make
and got this:

g++: and: No such file or directory
g++: SettingsddDesktopqtanimationframework-2.3-opensourceliblibQtSolutions_AnimationFramework-2.3d.a: No such file or directory
mingw32-make.exe[2]: *** [..libQtSolutions_AnimationFramework-2.3d.dll] Error 1
mingw32-make.exe[1]: *** [debug-all] Error 2
C:Qt2009.02mingwbinmingw32-make.exe: Leaving directory `C:/Documents and Settings/dd/Desktop/qtanimationframework-2.3-opensource’
C:Qt2009.02mingwbinmingw32-make.exe: *** [sub-buildlib-make_default-ordered] Error 2
Exited with code 2.
Error while building project qtanimationframework
When executing build step ‘Make’

please help
thanks

Commenting closed.

Get started today with Qt Download now