I am planning to move a circle in the graphics view but it doesn't work. Here is my source code:

circle.h
Qt Code:
  1. #ifndef CIRCLE_H
  2. #define CIRCLE_H
  3. #include <QGraphicsItem>
  4. #include <QPainter>
  5.  
  6. class Circle : public QObject, public QGraphicsItem
  7. {
  8. Q_OBJECT
  9. Q_PROPERTY(QPointF pos READ pos WRITE setPos)
  10. public:
  11. Circle();
  12. ~Circle();
  13. QRectF boundingRect() const;
  14. protected:
  15. void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
  16. };
  17.  
  18. #endif // CIRCLE_H
To copy to clipboard, switch view to plain text mode 
dialog.h
Qt Code:
  1. #ifndef DIALOG_H
  2. #define DIALOG_H
  3.  
  4. #include <QDialog>
  5. #include <QtGui>
  6. #include <QPropertyAnimation>
  7. #include "circle.h"
  8.  
  9. namespace Ui {
  10. class Dialog;
  11. }
  12.  
  13. class Dialog : public QDialog
  14. {
  15. Q_OBJECT
  16.  
  17. public:
  18. explicit Dialog(QWidget *parent = 0);
  19. ~Dialog();
  20.  
  21. private:
  22. Ui::Dialog *ui;
  23. Circle *circle;
  24. QPropertyAnimation *animation;
  25. };
  26.  
  27. #endif // DIALOG_H
To copy to clipboard, switch view to plain text mode 
circle.cpp
Qt Code:
  1. #include "circle.h"
  2.  
  3. Circle::Circle()
  4. {
  5.  
  6. }
  7.  
  8. Circle::~Circle()
  9. {
  10.  
  11. }
  12.  
  13. QRectF Circle::boundingRect() const
  14. {
  15. return QRectF(20, 100, 50, 50);
  16. }
  17.  
  18. void Circle::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
  19. {
  20. QRectF rect = boundingRect();
  21. QPen pen(Qt::NoPen);
  22. QBrush brush(Qt::blue);
  23. brush.setStyle(Qt::SolidPattern);
  24.  
  25. painter->setPen(pen);
  26. painter->setBrush(brush);
  27. painter->drawEllipse(rect);
  28. }
To copy to clipboard, switch view to plain text mode 
dialog.cpp
Qt Code:
  1. #include "dialog.h"
  2. #include "ui_dialog.h"
  3.  
  4. Dialog::Dialog(QWidget *parent) :
  5. QDialog(parent),
  6. ui(new Ui::Dialog)
  7. {
  8. ui->setupUi(this);
  9.  
  10. scene = new QGraphicsScene(this);
  11. ui->graphicsView->setScene(scene);
  12.  
  13. circle = new Circle;
  14. scene->addItem(circle);
  15.  
  16. animation = new QPropertyAnimation(circle, "geometry", NULL);
  17. animation->setDuration(5000);
  18. animation->setEndValue(QRect(500, 100, 150, 150));
  19.  
  20. animation->start();
  21. }
  22.  
  23. Dialog::~Dialog()
  24. {
  25. delete ui;
  26. }
To copy to clipboard, switch view to plain text mode 

Can anyone please tell me how to solve this thing? Thanks in advance.