connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(clicked()));
connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(clicked()));
connect(ui->pushButton_3, SIGNAL(clicked()), this, SLOT(clicked()));
ui->pushButton->setWhatsThis("b1");
ui->pushButton_2->setWhatsThis("b2");
ui->pushButton_3->setWhatsThis("b3");
ui->pushButton->setProperty("ttt","IamSoPoor");
ui->pushButton_2->setProperty("ttt","11");
ui->pushButton_3->setProperty("ttt","22");
void MainWindow::clicked()
{
auto obj = qobject_cast<QPushButton *>(sender());
qDebug()<<obj->text();
qDebug()<<obj->whatsThis();
qDebug()<<obj->property("ttt").toString();
}
void MainWindow::checkboxClicked(bool checked)
{
connect(ui->checkBox1, SIGNAL(clicked(bool)), this, SLOT(checkboxClicked(bool)));
connect(ui->checkBox2, SIGNAL(clicked(bool)), this, SLOT(checkboxClicked(bool)));
connect(ui->checkBox3, SIGNAL(clicked(bool)), this, SLOT(checkboxClicked(bool)));
connect(ui->checkBox4, SIGNAL(clicked(bool)), this, SLOT(checkboxClicked(bool)));
connect(ui->checkBox5, SIGNAL(clicked(bool)), this, SLOT(checkboxClicked(bool)));
connect(ui->checkBox6, SIGNAL(clicked(bool)), this, SLOT(checkboxClicked(bool)));
grp = new QButtonGroup(this);
grp->addButton(ui->checkBox1,0);
grp->addButton(ui->checkBox2,1);
grp->addButton(ui->checkBox3,2);
grp->addButton(ui->checkBox4,3);
grp->addButton(ui->checkBox5,4);
grp->addButton(ui->checkBox6,5);
auto checkBox = qobject_cast<QCheckBox*>(sender());
int id = grp->checkedId();
qDebug()<<"tt"<<checked<<checkBox->objectName()<<id;//checkBox1,whatisthis,property()
QString str = grp->checkedButton()->text();
}