You can call signal or slot like this---->
One signal can be connected to many slots:
connect(slider, SIGNAL(valueChanged(int)),
spinBox, SLOT(setValue(int)));
connect(slider, SIGNAL(valueChanged(int)),
this, SLOT(updateStatusBarIndicator(int)));
connect(slider, SIGNAL(valueChanged(int)),
spinBox, SLOT(setValue(int)));
connect(slider, SIGNAL(valueChanged(int)),
this, SLOT(updateStatusBarIndicator(int)));
To copy to clipboard, switch view to plain text mode
Many signals can be connected to the same slot:
connect(lcd, SIGNAL(overflow()),
this, SLOT(handleMathError()));
connect(calculator, SIGNAL(divisionByZero()),
this, SLOT(handleMathError()));
connect(lcd, SIGNAL(overflow()),
this, SLOT(handleMathError()));
connect(calculator, SIGNAL(divisionByZero()),
this, SLOT(handleMathError()));
To copy to clipboard, switch view to plain text mode
A signal can be connected to another signal:
connect(lineEdit,
SIGNAL(textChanged
(const QString &)),
this,
SIGNAL(updateRecord
(const QString &)));
connect(lineEdit, SIGNAL(textChanged(const QString &)),
this, SIGNAL(updateRecord(const QString &)));
To copy to clipboard, switch view to plain text mode
When the first signal is emitted, the second signal is emitted as well.
Apart from that, signal–signal connections are indistinguishable from
signal–slot connections.
Bookmarks