title: Qt when calling connect gives me an error
body: <p>I'm having problem with connect. My problem is:
  I have a class called eventos (events) that will manage all the objects events (buttons, lists etc...) but when I call an event, it gives me  an memory reading error.
  Here is my code:</p>
  
  <p>My main class:</p>
  
  <pre><code>#include "ratagbc.h"
  #include "eventos.h"
  
  RataGBC::RataGBC(QWidget *parent, Qt::WFlags flags)
      : QMainWindow(parent, flags)
  {
      eventos e;
      connect(ui.runBtn,SIGNAL(clicked()),this,SLOT(e.on_runBtn_clicked()));
      ui.setupUi(this);
  }
  
  RataGBC::~RataGBC()
  {
  
  }
  </code></pre>
  
  <p>eventos.h:</p>
  
  <pre><code>#include QDialog.h
  #include "ui_ratagbc.h"
  
  class eventos : public QDialog, public Ui::RataGBCClass { 
      Q_OBJECT    
  public:     
          eventos(void);
      ~eventos(void);
  
      public slots:       void on_runBtn_clicked(); };
  </code></pre>
  
  <p>eventos.cpp:</p>
  
  <pre><code>#include "eventos.h"
  #include &lt;QMessageBox&gt;
  
  
  eventos::eventos(void)
  {
  }
  
  
  eventos::~eventos(void)
  {
  }
  
  void eventos::on_runBtn_clicked()
  {
      QMessageBox qb;
      qb.setText("Rata");
      qb.exec();
  }
  </code></pre>
  
  <p>The error is: </p>
  
  <blockquote>
    <p>Unhandled exception at 0x776a15de in RataGBC.exe: 0xC0000005: Access violation reading location 0x00000964.</p>
  </blockquote>
  
  <p>Debugging I realized (or guessed?) that the error seems to be in the SINGAL call.</p>