16 QWidget *widget = qobject_cast<QWidget *>(obj);
24 QLabel *label = qobject_cast<QLabel *>(obj);
30 if (QLabel *label = qobject_cast<QLabel *>(obj)) {
32 label->setText(tr(
"Ping"));
33 }
else if (QPushButton *button = qobject_cast<QPushButton *>(obj)) {
34 button->setText(tr(
"Pong!"));