QSignMapper *mapper = new QSignMapper(this)
QPushButton *btn1 = new QPushButton(this);
btn1->setText("btn1");
QPushButton *btn2 = new QPushButton(this);
btn2->setText("btn2");
mapper->setMapping(btn1,btn1->text());
mapper->setMapping(btn2,btn2->text());
connect(btn1,SIGNAL(clicked()),mapper,SLOT(map()));
connect(btn2,SIGNAL(clicked()),mapper,SLOT(map()));
connect(mapper,SIGNAL(map(QString),this,SLOT(disStr(QString)));
整体的作用是通过一个无参的信号转化成有参的信号,然后传给槽函数进行操作