可通过WhatsThis
设置属性
connect(ui->pushButton_login, &QPushButton::clicked, this, &KLoginSetupDlg::handlePushButtonClicked);
connect(ui->pushButton_cancel, &QPushButton::clicked, this, &KLoginSetupDlg::handlePushButtonClicked);
void KLoginSetupDlg::handlePushButtonClicked(){
QPushButton* btn = qobject_cast<QPushButton*>(sender()); // (QPushButton*)sender();
QString tag= btn->whatsThis();
}