Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include "dialog.h"
  2. #include "ui_dialog.h"
  3. #include <QtGui>
  4. #include <QMessageBox>
  5. #include <QString>
  6.  
  7. Dialog::Dialog(QWidget *parent) :
  8. QDialog(parent),
  9. ui(new Ui::Dialog)
  10. {
  11. ui->setupUi(this);
  12. //ui->checkBox->setChecked(true);
  13.  
  14. }
  15.  
  16. Dialog::~Dialog()
  17. {
  18. delete ui;
  19. }
  20.  
  21. void Dialog::on_pushButton_clicked()
  22. {
  23.  
  24. if(ui->checkBox->isChecked() && ui->checkBox_2->isChecked())
  25. {
  26. QMessageBox::information(this,"Result","Please chose only one !");
  27. }
  28.  
  29.  
  30.  
  31. if(ui->checkBox->isChecked())
  32. {
  33. QMessageBox::information(this,"Result","Cool another Male !");
  34. }
  35.  
  36.  
  37.  
  38. if(ui->checkBox_2->isChecked())
  39. {
  40. QMessageBox::information(this,"Result", "Yay a female");
  41. }
  42.  
  43.  
  44.  
  45. if(!(ui->checkBox->isChecked() || ui->checkBox_2->isChecked()))
  46. {
  47. QMessageBox::information(this,"Result","Please check a box !");
  48. }
  49.  
  50.  
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement