title: Qt4 application crash, segmentaton fault when click connected button
body: <p>I've created a simple application with QGraphicsView and I have a problem with connected button.
  There is a simple window with QGraphicsScene and one QPushButton and a function which should add a rectangle to my scene. Compilation is ok, it works and after I click this button application crash. </p>
  
  <p>.h file:</p>
  
  <pre><code>class Canvas : public QWidget{
      Q_OBJECT
  public:
      Canvas(QWidget *parent = 0);
  
  private slots:
      void addPoint();
  
  private:
      QGraphicsScene *scene;
      QPushButton *btn;
  
  };
  </code></pre>
  
  <p>.cpp file:</p>
  
  <pre><code>Canvas::Canvas(QWidget *parent)
      : QWidget(parent)
  {
      QVBoxLayout *vbox = new QVBoxLayout(this);
      vbox-&gt;setSpacing(1);
      QPushButton *btn = new QPushButton("test", this);
      QGraphicsView *view = new QGraphicsView(this);
      QGraphicsScene *scene = new QGraphicsScene(this);
      view-&gt;setScene(scene);
      vbox-&gt;addWidget(view);
      vbox-&gt;addWidget(btn);
      setLayout(vbox);
      connect(btn, SIGNAL(clicked()), this, SLOT(addPoint()));
  }
  
  void Canvas::addPoint()
  {
      scene-&gt;addRect(100,0,80,100);
  }
  </code></pre>
  
  <p>Also debuger said:</p>
  
  <pre><code>The inferior stopped because it received a signal from the Operating System.
  
  Signal name : SIGSEGV
  Signal meaning : Segmentation fault
  </code></pre>
  
  <p>And points this line:</p>
  
  <pre><code>{ return addRect(QRectF(x, y, w, h), pen, brush); }
  </code></pre>
  
  <p>What am I doing wrong? Thanks in advance.</p>