Important: Please read the Qt Code of Conduct -

Code worked before, updated Qt and doesn't now :c [SOLVED]

  • To give a bit of explanation:
    The program should link a spinbox and a slider so that as you change the value of one it would alter the value of the other; so at all times these would have the same value. This worked perfectly fine before but after updating it stopped working, here is my code:
    @#include <QApplication>
    #include <QHBoxLayout>
    #include <QSlider>
    #include <QSpinBox>

    int main(int argc, char *argv[])
    QApplication a(argc, argv);

    QWidget *mainWindow = new QWidget;
    mainWindow->setWindowTitle("How many chicken wings?");
    QSpinBox *spinner = new QSpinBox;
    QSlider *slider = new QSlider(Qt::Horizontal);
    QObject::connect(spinner, SIGNAL(valueChange(int)), slider, SLOT(setValue(int)));
    QObject::connect(slider, SIGNAL(valueChange(int)), spinner, SLOT(setValue(int)));
    QHBoxLayout *layout = new QHBoxLayout;
    return a.exec(&#41;;


    Any help would be much appreciated.

  • The QSpinBox SIGNAL is not valueChange(int), but valueChanged(int)

    After changing that it works fine with Qt 5.1.

  • Oh wow, that was a simple mistake; thanks!

Log in to reply