title: QGraphicsscene: How to implement selection (by rubber band) behavior of QGraphicsItems?
body: <p>so I know there are quite a lot of similar questions on here but none really gets to the specific point I am interested in.</p>
  
  <p>I want to implement custom selection behavior of a <code>QGraphicsItem</code>s (e.g. change its color on selection). Apparently this is handled by the items themselves so one needs to make an own class extending <code>QGraphicsItem</code>. There, I am really missing something, like an <code>onSelectionToggled</code> method (slot) that one could override. But I finally figured out that one has to override the <code>mousePressEvent</code> method (after all "selection" is just a more concrete term for the abstract concept of a left-click).</p>
  
  <p>So if in this method I call:</p>
  
  <pre><code>  setPen( QPen( QColor( "orange" ) ) );
    update();
  </code></pre>
  
  <p>The color actually changes when I click a single item. 
  But not when the selection happens via the rubber band of the scene. 
  Since there is no <code>onSelectionToggled</code>, I imagined the scene would "simulate" a respective mouse event for the intersected items.</p>
  
  <p>Since this is not the case, my question is: "How can I react to such a selection via rubber band?" Ideally in a "unified" way (no extra code for individual selection by mouse click).</p>
  
  <p>Also, I wonder how I can prevent the dotted bounding rectangle to be drawn on selection. I don't want it and was hoping to get rid of it automatically when subclassing <code>QGraphicsItem</code>.</p>