Quote Originally Posted by Holy View Post
// I want the item to move step by step after any 1000 ms on the Screen
QMoveEvent *event;
int x=event->pos().x();
int y=event->pos().y();
c1->moveBy((qreal)x,(qreal)y);
It won't work --- you take x and y values from an uninitialized object.


Quote Originally Posted by Holy View Post
startTimer(1000);
When you use startTimer(), you have to reimplement QObject::timerEvent() and put the code that you want to run every second there.

You need something like:
Qt Code:
  1. void MainGui::timerEvent( QTimerEvent *e )
  2. {
  3. Q_UNUSED( e);
  4. scene->advance();
  5. }
To copy to clipboard, switch view to plain text mode 
You can also consider using QTimer instead of startTimer()/timerEvent().

To make scene->advance() work, you have to reimplement QGraphicsItem::advance() in your Container class or use QGraphicsItemAnimation.

P.S. Please, don't post the same question twice in two different threads.