title: Qt QSignalMapper doesn't work
body: <p>I'm trying to use QSignalMapper to send signal sender(QPushButton) to slot when it's clicked. But it doesn't work and I really don't know why.</p>
  
  <p>If you know a different way to do this, it will be great to inform me, but I really want to know how to use QSignalMapper because it can be useful in the future.</p>
  
  <p>moviebase.h</p>
  
  <pre><code>    #ifndef MOVIEBASE_H
      #define MOVIEBASE_H
  
      #include &lt;QtGui/QMainWindow&gt;
      #include &lt;Qt\qsignalmapper.h&gt;
  
      #include "ui_moviebase.h"
      #include "include\DBAdapter.h"
      #include "include\objView.h"
  
      class MovieBase : public QMainWindow
      {
  
          Q_OBJECT
  
      public:
          MovieBase(QWidget *parent = 0, Qt::WFlags flags = 0);
          ~MovieBase();
  
      private:
  
          Ui::MovieBaseClass ui;
  
          DBAdapter *db;
          DBAdapter::Type type;
          QPushButton *buttonChecked;
          QSignalMapper *pushButtonMapper;
  
          void setMainButtonsFunct();
  
  
      private slots:
          void button_pushed(const QPushButton &amp;);
  
      };
  
      #endif // MOVIEBASE_H
  </code></pre>
  
  <p>moviebase.cpp</p>
  
  <pre><code>#include "moviebase.h"
  
  MovieBase::MovieBase(QWidget *parent, Qt::WFlags flags)
      : QMainWindow(parent, flags)
  {
      ui.setupUi(this);
      db = new DBAdapter();
  
      this-&gt;type = DBAdapter::Movie;
  
      this-&gt;setMainButtonsFunct();
  
      ObjView *obj = new ObjView(this-&gt;ui.objView);
  
      obj-&gt;view(db-&gt;get_All_Elements(this-&gt;type));
  }
  
  void MovieBase::setMainButtonsFunct()
  {
      this-&gt;buttonChecked = ui.watchedButton;
  
      this-&gt;pushButtonMapper = new QSignalMapper(this);
  
      connect(this-&gt;ui.watchedButton, SIGNAL(clicked()), this-&gt;pushButtonMapper, SLOT(map()));
      connect(this-&gt;ui.towatchButton, SIGNAL(clicked()),  this-&gt;pushButtonMapper, SLOT(map()));
      connect(this-&gt;ui.availableButton, SIGNAL(clicked()),  this-&gt;pushButtonMapper, SLOT(map()));
      connect(this-&gt;ui.allButton, SIGNAL(clicked()),  this-&gt;pushButtonMapper, SLOT(map()));
  
      this-&gt;pushButtonMapper-&gt;setMapping(this-&gt;ui.watchedButton, this-&gt;ui.watchedButton);
      this-&gt;pushButtonMapper-&gt;setMapping(this-&gt;ui.towatchButton, this-&gt;ui.towatchButton);
      this-&gt;pushButtonMapper-&gt;setMapping(this-&gt;ui.availableButton, this-&gt;ui.availableButton);
      this-&gt;pushButtonMapper-&gt;setMapping(this-&gt;ui.allButton, this-&gt;ui.allButton);
  
      connect(this-&gt;pushButtonMapper, SIGNAL(mapped(const QPushButton &amp;)), this, SLOT(button_pushed(const QPushButton &amp;)));
  }
  
  void MovieBase::button_pushed(const QPushButton &amp;sender)
  {
      qDebug() &lt;&lt; "button pushed";
      this-&gt;ui.watchedButton-&gt;setChecked(false);
  }
  
  MovieBase::~MovieBase()
  {
  
  }
  </code></pre>