title: QGraphicsView rubber band selection rectangle not visible
body: <p>I have a <code>QGraphicsView</code> widget with lots of items on scene. I am panning the view on ctr+left mouse click and zooming it to rectangle of rubber band created  with left mouse button drag. I am not able to see rubber band selection rectangle (dotted lines) whereas rubberband selection functionality works fine. Can anybody help me understand this?.<br>I use these flags in my view:</p>
  
  <pre><code>setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
  setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
  setRenderHints(QPainter::HighQualityAntialiasing | QPainter::SmoothPixmapTransform);
  setOptimizationFlag(QGraphicsView::DontSavePainterState,true);
  setCacheMode(QGraphicsView::CacheBackground);
  setOptimizationFlag(QGraphicsView::DontAdjustForAntialiasing);
  setViewport(new QGLWidget);
  </code></pre>
  
  <p>below are my event handlers.</p>
  
  <p>Mouse press event handler:</p>
  
  <pre><code>void MyView::mousePressEvent(QMouseEvent* event)
  {
      if(event-&gt;button()==Qt::LeftButton)
      {       
          if(event-&gt;modifiers()==Qt::ControlModifier)
          {
              setDragMode(QGraphicsView::NoDrag);
              m_rubberBandActive = false;         
              mousepressed=true;
              m_lastDragPos = event-&gt;pos();
              return;
          }
          else
          {           
              setDragMode(QGraphicsView::RubberBandDrag);
              m_rubberBandOrigin = event-&gt;pos();
              m_rubberBandActive = true;
          }
      }   
      event-&gt;accept();
     }
     else
     {    
        QWidget::mousePressEvent(event);
     }    
  }
  </code></pre>
  
  <p>Mouse move event:</p>
  
  <pre><code>void MyView::mouseMoveEvent(QMouseEvent* event)
  {
  if(mousepressed)
  {
      QPointF delta = mapToScene(event-&gt;pos()) - mapToScene(m_lastDragPos);
      this-&gt;panView(delta);
      m_lastDragPos = event-&gt;pos();   
      return;
  }
  event-&gt;accept();
  }
  </code></pre>
  
  <p>Mouse release event Handler:</p>
  
  <pre><code>void MyView::mouseReleaseEvent(QMouseEvent *event)
  {
  if (m_rubberBandActive)
  {
      QPoint rubberBandEnd = event-&gt;pos();        
      QRectF zoomRectInScene = QRectF(mapToScene(m_rubberBandOrigin),mapToScene(rubberBandEnd));
  
      fitInView(zoomRectInScene, Qt::KeepAspectRatio);
      m_rubberBandActive = false;
  }
  
  mousepressed=false;
  event-&gt;accept();
  }
  </code></pre>
  
  <p>Pan view:</p>
  
  <pre><code>void MyView::panView(QPointF delta)
  {
      QPoint viewCenter(viewport()-&gt;width() / 2 + delta.x(), viewport()-&gt;height() / 2 + delta.y());
      QPointF newCenter = mapToScene(viewCenter);
      centerOn(newCenter);
  }
  </code></pre>