In the next example, we shall connect two signals from different widgets to a single slot. Let's modify our earlier program as follows:
#include <QApplication>#include <QVBoxLayout>#include <QLabel>#include <QDial>#include <QSlider>#include <QLCDNumber>int main(int argc, char *argv[]){ QApplication app(argc, argv); QWidget *window = new QWidget; QVBoxLayout *layout = new QVBoxLayout; QDial *volumeDial= new QDial; QSlider *lengthSlider = new QSlider(Qt::Horizontal); QLCDNumber *volumeLCD = new QLCDNumber; volumeLCD->setPalette(Qt::red); lengthSlider->setTickPosition(QSlider::TicksAbove); lengthSlider->setTickInterval(10); lengthSlider->setSingleStep(1); lengthSlider->setMinimum(0); lengthSlider->setMaximum(100); ...