title: QT QgraphicsScene mouse press event not registered
body: <p>I am starting up in QT for a simple drawing application and i have problem in with the mouse event handles of QGraphicsView.</p>
  
  <p>Here is a summary of the code (please bear in mind this is made to get the basic operation right only. The main just creates a QMainWindow-like element that has the following constructor:</p>
  
  <pre><code>MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent)
  {
      myCanvas = new GraphicsView;
      myCanvas -&gt; sizeGS(0, 0, 800, 600);
      setCentralWidget(myCanvas -&gt; getView());
      resize(800,600);
  }
  </code></pre>
  
  <p>my Canvas belongs to the class derived from QGraphicsView where any mouse press event is not registered at all.</p>
  
  <pre><code>class GraphicsView : public QGraphicsView
  {
      Q_OBJECT
  public:
      explicit GraphicsView(QObject *parent = 0);
      ~GraphicsView(){};
      void sizeGS(int x0, int y0, int x1, int y1);
      QGraphicsView* getView() {return canvasView;};
  
  protected:
      operationType currentOperation;
  
  private:
      static const int exMaxPolygonSize = 10;
  
      QGraphicsScene *canvasScene;
      QGraphicsView *canvasView;
  
      std::vector&lt;QPointF&gt; mousePos;
      QList&lt;QGraphicsItem *&gt; draftedItems;
      QPointF topLeft;
      QPointF bottomRight;
  
      void resetLineDrawing();
      void completeDrawing();
      void mousePressEvent(QMouseEvent *mouseEvent);
  };
  </code></pre>
  
  <p>and the key parts of the class are the following two functions:</p>
  
  <pre><code>GraphicsView::GraphicsView(QObject *parent) :
      QGraphicsView()
  {
  canvasScene = new QGraphicsScene;
  canvasView = new QGraphicsView(canvasScene);
  mousePos.reserve(exMaxPolygonSize);
  //canvasView-&gt;setMouseTracking(true);
  canvasView-&gt;setRenderHints( QPainter::Antialiasing );
  
  qDebug() &lt;&lt; "constructor is ok";
  }
  
  void GraphicsView::mousePressEvent(QMouseEvent *event)
  {
  qDebug() &lt;&lt; "mouse grabbed!";
  };
  </code></pre>
  
  <p>The mousePressEvent have been tried also with test on the buttons and so on like with no difference.</p>
  
  <p>Any help to understand what is that i am missing would help. 
  I am using QT5.2 on OSX.</p>
  
  <p>Thanks</p>
  
  <p>EDIT: This code is for under standing how to control the mouse events for a QGView being central widget of a QMainWindow.</p>