PDA

View Full Version : Question about animation



franco.amato
26th October 2010, 00:27
Hi to all,
I'm reading the Animation Framework and I would try it in my application.
I would animate the position of a little dialog that I show pressing a button.

This is the code I tried:



// executed on the released() signal of a button
void WaveWidget::onShowInfoPanel()
{
if( !m_panel->isVisible() )
{
m_panel->setVisible(true);
QPropertyAnimation animation(m_panel, "geometry");
animation.setDuration(2000);
animation.setStartValue(QRect(0, 0, 135, 240));//just an example
animation.setEndValue(QRect(250, 250, 135, 240));//just an example
animation.start();
}
else
m_panel->setVisible(false);
}

So I would give to the panel an animated effect but nothing happens when I show the panel. When I press the button the panes is shown without any special effect.

Is my code incorrect?
Regards

wysota
26th October 2010, 00:33
Yes, out of scope again.

franco.amato
26th October 2010, 00:56
Yes, out of scope again.

Solved.
Very amazing the effect :)