I'm having a real hard time with finding the correct positioning of items in a scene.
1-rotate an item based on the angle of the mouse-to-item position. = Succesfull!
2-create an item, and send it from it's parent position to in direction to the mouse = Problems...

The following code is successful in other platforms such as Adobe Flash:
Qt Code:
  1. // When mouse is clicked =
  2.  
  3. Shot *tiro = new Shot();
  4. double velocity = 10;
  5. double radians = angle * PI / 180; // where angle is successfully defined previously
  6.  
  7. double velx = velocity * cos(radians);
  8. double vely = velocity * sin(radians);
  9. double x0 = ((redShip->scenePos().x()+redShip->boundingRect().width()/2)+50 ) * cos(radians);
  10. double y0 = ((redShip->scenePos().y()+redShip->boundingRect().width()/2)+50 ) * sin(radians);
  11. double x = x0 + velx ;
  12. double y = y0 + vely ;
  13.  
  14. tiro->newShot(scene,x0,y0);
  15. tiro->setDirection(x,x);
To copy to clipboard, switch view to plain text mode 

Shot.cpp:
Qt Code:
  1. void Shot::newShot(QGraphicsScene * scene, double x, double y)
  2. {
  3. ball = new QGraphicsEllipseItem(x,x,10,10);
  4.  
  5. scene->addItem(ball);
  6.  
  7. }
  8.  
  9. void Shot::setDirection(double x, double y)
  10. {
  11. dirx = x;
  12. diry = y;
  13. }
  14.  
  15. //updatePos() is called every second by a QTimer in Shot::Shot()
  16. void Shot::updatePos()
  17. {
  18. x += dirx;
  19. y += diry;
  20. ball->setPos(x,y);
  21. }
To copy to clipboard, switch view to plain text mode 

The above just creates a shot anywhere in a up-down / left-right diagonal
and sends it following the said diagonal. What am I doing wrong (never Qt's fault...)