不同点式槽可以链接到信号。通过这种方式可以在每次信号发射的的时候做到调用槽函数
connect()语句是这样的
connect(sender, SIGNAL(signal), receiver, SLOT(slot));
在这里sender和receiver是指向信号对象和槽对象的指针。宏SIGNAL()和SLOTS()负责转换他们的参数到字符串。

当然一个信号可以连接到多个槽(似乎都是这样的)
connect(slider, SIGNAL(valueChanged(int)),
        spinBox, SLOT(setValue(
int)));
connect(slider, SIGNAL(valueChanged(
int)),
        
this, SLOT(updateStatusBarIndicator(int)));
同样多个信号可以连接到单个槽
例如:
connect(lcd, SIGNAL(overflow()),
        
this, SLOT(handleMathError()));
connect(calculator, SIGNAL(divisionByZero()),
        
this, SLOT(handleMathError()));
除此之外信号可以连接到其他信号(见过的其他插槽系统似乎不大可以?)
connect(lineEdit, SIGNAL(textChanged(const QString &)),
        
this, SIGNAL(updateRecord(const QString &)));
需要指出的是信号信号链接和信号插槽连接时不同的
既然信号和插槽可以连接那么他们应该可以断开,如下:
disconnect(lcd, SIGNAL(overflow()),
           
this, SLOT(handleMathError()));
一个简单的例子:
class Employee : public QObject
{
    Q_OBJECT
public:
    Employee() { mySalary 
= 0; }
    
int salary() const { return mySalary; }
public slots:
    
void setSalary(int newSalary);
signals:
    
void salaryChanged(int newSalary);
private:
    
int mySalary;
};
void Employee::setSalary(int newSalary)
{
    
if (newSalary != mySalary) {
        mySalary 
= newSalary;
        emit salaryChanged(mySalary);
    }
}

 
说明
关键字 public slots:和signals 他们用于修饰插槽函数和信号函数;
至于信号的发射通过关键字 emit来实现

通过本文基本掌握了QT的信号插槽机制