Friday, June 26, 2009

Python-purple at FISL 10

(Me, Ricardo Salveti and Anderson Briglia - thanks to Henry Vieira for the picture!)


Yesterday me and Anderson Briglia spoke about python-purple (a libpurple binding for Python written using Cython) at FISL 10, the most valuable free software event in Latin America. Actually, we had to compete with Richard Stallman's presentation together with the brazilliam soccer team game (which was happening on the same time!). Public acceptance was good and we hope to get new developers to join the team :) Anyway, we made available the presentation (sorry, brazillian portuguese only) at the project's documentation section.

[]s!

Friday, June 5, 2009

Qt's Animation framework API updates

Hi again,
Since my previous post, we've been using the QAnimationState class together with the convenience method addAnimateTransition() to get animated transitions between states. Now the API's got even cleaner and easier to understand, you don't have to use a special state in order to associate animated transitions to it any longer ;) I've updated the Qt's documentation about the animation framework, you can read it below:

Animations and States

When using a state machine, we can associate an animation to a transition between states using a QSignalTransition or QEventTransition class. These classes are both derived from QAbstractTransition, which defines the convenience function addAnimation() that enables the appending of one or more animations triggered when the transition occurs.

We also have the possibility to associate properties with the states rather than setting the start and end values ourselves. Below is a complete code example that animates the geometry of a QPushButton.
QPushButton *button = new QPushButton("Animated Button");
button->show();

QStateMachine *machine = new QStateMachine;

QState *state1 = new QState(machine->rootState());
state1->assignProperty(button, "geometry", QRect(0, 0, 100, 30));

machine->setInitialState(state1);

QState *state2 = new QState(machine->rootState());
state2->assignProperty(button, "geometry", QRect(250, 250, 100, 30));

QSignalTransition *transition1 = state1->addTransition(button,
SIGNAL(clicked()), state2);
transition1->addAnimation(new QPropertyAnimation(button, "geometry"));

QSignalTransition *transition2 = state2->addTransition(button,
SIGNAL(clicked()), state1);

transition2->addAnimation(new QPropertyAnimation(button, "geometry"));

machine->start();
You can find the most up-to-date documentation about the Animation Framework and State Machine framework here: http://doc.trolltech.com/4.6-snapshot/index.html