qt中的强制类型转换

方法一:

QObject *object = QObject::sender();
QPushButton *push_button = qobject_cast<QPushButton *>(object);

方法二:

QPushButton*dataRecv = static_cast<QPushButton*>(sender());

猜你喜欢

转载自blog.csdn.net/mafucun1988/article/details/88715422