If your sphere is a class deriving from graphics item (and it should be), and it lives in a scene (from what you said, so I assume it's QGraphicsScene) then in the constructor of the sphere set setAcceptHoverEvents( true ), and reimplement hoverEnterEvent and hoverLeaveEvent.

Something like that:
Qt Code:
  1. class MySphere : public QGraphicsItem
  2. {
  3. public:
  4. MySphere( QGraphicsItem* parent = 0 ) : QGraphicsItem( parent ), myName( "Not named!" )
  5. {
  6. this->setAcceptHoverEvents( true );
  7. }
  8.  
  9. void setValues( int x, int y, int z )
  10. {
  11. // do something
  12. }
  13.  
  14. void setName( const QString& name )
  15. {
  16. this->myName = name;
  17. }
  18.  
  19. protected:
  20. // add painting and all else you need
  21.  
  22. void hoverEnterEvent( QGraphicsSceneHoverEvent* event )
  23. {
  24. QToolTip::showText( event->screenPos(), this->myName );
  25. }
  26.  
  27. void hoverLeaveEvent( QGraphicsSceneHoverEvent* event )
  28. {
  29. Q_UNUSED( event );
  30.  
  31. QToolTip::hideText();
  32. }
  33.  
  34. private:
  35. QString myName;
  36. };
To copy to clipboard, switch view to plain text mode 

Edit:
btw - dust on my screen is bigger than spheres on this black image