title: Qt signal forwarding - what am I doing wrong?
body: <p>I am writing a test Qt application in which everything works fine until I try to receive a signal by slot and then emit another signal (MyWidget::setValue doesn't cause an emission of MyWidget::valueChanged). What am I doing wrong?</p>
  
  <pre><code>#include &lt;QApplication&gt;
  #include &lt;QVBoxLayout&gt;
  #include &lt;QSpinBox&gt;
  #include &lt;QSlider&gt;
  
  class MyWidget: public QWidget {
      Q_OBJECT
  signals:
      void valueChanged(int value);
  public slots:
      void setValue(int value){
        emit valueChanged(value);
      }
  };
  
  int main(int argc, char *argv[])
  {
    QApplication app(argc, argv);
    MyWidget* win = new MyWidget;
    QVBoxLayout* layout = new QVBoxLayout(win);
    QSpinBox* spin =new QSpinBox();
    QSlider* slider = new QSlider(Qt::Horizontal);
  
    spin-&gt;setMinimum(-100);
    spin-&gt;setMaximum(100);
  
    slider-&gt;setMinimum(-100);
    slider-&gt;setMaximum(100);
  
    layout-&gt;addWidget(spin);
    layout-&gt;addWidget(slider);
  
    QObject::connect(spin, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int)));
    QObject::connect(slider, SIGNAL(valueChanged(int)), win, SLOT(setValue(int)));
    QObject::connect(win, SIGNAL(valueChanged(int)), spin, SLOT(setValue(int)));
  
    win-&gt;show();
    return app.exec();
  }
  </code></pre>