title: Error while using QGraphicsScene functions in Qt
body: <p>I'm getting errors when I run a qt project and I can't understand what is the reason</p>
  
  <p>errors:</p>
  
  <blockquote>
    <p>'class MainWindow' has no member named 'setSceneRect'   'class
    MainWindow' has no member named 'setScene'  `mapToScene' was not
    declared in this scope</p>
  </blockquote>
  
  <p>the code:</p>
  
  <p>mainwindow.cpp:</p>
  
  <pre><code> MainWindow::MainWindow(QWidget *parent)
  : QMainWindow(parent), ui(new Ui::MainWindow)
  {
  ui-&gt;setupUi(this);
  QGridLayout * gridLayout = new QGridLayout(ui-&gt;centralWidget);
  gridLayout-&gt;addWidget( new MainWindow() );
  
  scene = new QGraphicsScene();
      this-&gt;setSceneRect(50, 50, 350, 350);
      this-&gt;setScene(scene);
   }
  
   void MainWindow::mousePressEvent(QMouseEvent * e)
  {
      double rad = 1;
      QPointF pt = mapToScene(e-&gt;pos());
      scene-&gt;addEllipse(pt.x()-rad, pt.y()-rad, rad*2.0, rad*2.0,
          QPen(), QBrush(Qt::SolidPattern));
  }
  </code></pre>
  
  <p>mainwindow.h:</p>
  
  <pre><code>private:
  Ui::MainWindow *ui;
  QGraphicsScene * scene;
  </code></pre>