You are mixing two styles of connect(): using the SIGNAL() and SLOT() macros, or direct function references.
connect(ui->slider1, SIGNAL(valueChanged(int)), ui->slider2, SLOT(setValue(int)));
connect(ui->slider1, SIGNAL(valueChanged(int)), ui->slider3, SLOT(setValue(int)));
connect(ui->slider1, SIGNAL(valueChanged(int)), ui->slider2, SLOT(setValue(int)));
connect(ui->slider1, SIGNAL(valueChanged(int)), ui->slider3, SLOT(setValue(int)));
To copy to clipboard, switch view to plain text mode
Or something like
connect(ui->slider1, &QSlider::valueChanged, ui->slider2, &QSlider::setValue);
connect(ui->slider1, &QSlider::valueChanged, ui->slider3, &QSlider::setValue);
connect(ui->slider1, &QSlider::valueChanged, ui->slider2, &QSlider::setValue);
connect(ui->slider1, &QSlider::valueChanged, ui->slider3, &QSlider::setValue);
To copy to clipboard, switch view to plain text mode
You should be able to connect all the sliders directly to each other without a recursion issue: the signals are only issued when the new value is different from the existing value.
Bookmarks