QRadioButton
#include "dialog.h" #include "ui_dialog.h" #include <QtCore> #include <QtGui> #include <QMessageBox> Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); } Dialog::~Dialog() { delete ui; } void Dialog::on_pushButton_clicked() { //ui->lineEdit->setText("Hello cat"); //QMessageBox::information(this,"Title",ui->lineEdit->text()); if(ui->radioButton->isChecked()) { QMessageBox::information(this,"Title",ui->radioButton->text()); } if(ui->radioButton_2->isChecked()) { QMessageBox::information(this,"Title",ui->radioButton_2->text()); } }