title: Qt Graphics View: detecting collision direction
body: <p>I'm trying to create a game using qt. I have some obstacles (QPixmapItem) in a graphics view. I have a ball, and what I want is that it bounces off the obstacles. How can I detect the normal of the surface of the obstacle, so that I can calculate the new moving direction? For example:</p>
  
  <pre><code>------------------------------
      / \          |
     /   \         | 
    /     \        v
   /       \       ^
  /         \      |
  </code></pre>