#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); ui->checkBox->setChecked(true); } Dialog::~Dialog() { delete ui; } void Dialog::on_pushButton_clicked() { //ui->lineEdit->setText("Hello cat"); //QMessageBox::information(this,"Title",ui->lineEdit->text()); if(ui->checkBox->isChecked()) { QMessageBox::information(this,"cats","You like cats"); } else { QMessageBox::information(this,"cats","You don't like cats"); } }