I already asked a question about this application.

I'm designing a chess application (with extended controls), but the movement of the peaces take place in a QGraphicsScene, designed to hold the board.

The board is sharp and pretty without movements :

Screen shot 2013-01-26 at 6.09.56 PM.jpg

When I move an element (next to the frame) this happens :

Screen shot 2013-01-26 at 6.10.03 PM.jpg

Parts of the code related to this :

Qt Code:
  1. #ifndef ChessElement_H
  2. #define ChessElement_H
  3. #include <QGraphicsItem>
  4. Class QPainter;
  5.  
  6. class ChessElement : public QGraphicsItem
  7. {
  8.  
  9. public:
  10.  
  11. QImage *g;
  12. char type;
  13. char identity;
  14. int color;
  15. int rank;
  16. bool isOccupied;
  17. bool movflag;
  18. int rawCount;
  19. int rawRank;
  20.  
  21.  
  22.  
  23. public : ChessElement(QImage*,int,bool,char,int,char,int,int);
  24.  
  25. public :QRectF boundingRect() const ;
  26.  
  27. public :void paint(QPainter*, const QStyleOptionGraphicsItem*,QWidget *);
  28.  
  29.  
  30.  
  31. };
  32.  
  33. #endif // ChessElement_H
To copy to clipboard, switch view to plain text mode 

Paint function :
Qt Code:
  1. QRectF ChessElement::boundingRect() const
  2. {
  3.  
  4. return QRectF(0,0,30,30);
  5.  
  6. }
  7.  
  8. void ChessElement:: paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
  9. QWidget *widget)
  10. {
  11. QPoint *s = new QPoint(0,0);
  12. painter->drawImage(*s,*g);
  13. delete s;
  14.  
  15.  
  16.  
  17. }
To copy to clipboard, switch view to plain text mode 

what is causing this white space ? I is it related to the re-drawing of items after movement.