How to get which QradioButton invoke the SLOT
问题 I create several QradioButton and connect to the same SLOT. In the slot, I want to know which QradioButton invoke the slot and do the related action. I found there is a way by using qobject_cast and QObject::sender(), but it seems not work. Here is the code: header file: class dialoginput : public QDialog { Q_OBJECT public: dialoginput(QWidget *parent = 0); QRadioButton *radio1; QRadioButton *radio2; QRadioButton *radio3; private slots: void setText_2(); private: QLabel *label_0_0; QLabel