test.h:
private slots:
void MoveControl (int value);
private:
QTimeLine* timeLineMove;
test.cpp:
void Test
{
timeLineMove = new QTimeLine (300, this);
timeLineMove->setFrameRange (0, 100);
connect (timeLineMove, SIGNAL (frameChanged (int)), this, SLOT (MoveControl (int)));
}
void Test::MoveControl (int value)
{
控件->move (0, value);
}
然后你调用
timeLineMove->start ();
就可以了