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());
    }
}

  

posted @ 2016-11-29 10:33  mCat  Views(163)  Comments(0Edit  收藏  举报