I'm a beginner in Qt/C++ so while I was learning from some tutorials I wanted to make something other than the tutorial but didn't know exactly the way how.
Here is the code, I'm using curently http://pastebin.com/x612nAPV
#include "dialog.h"
#include "ui_dialog.h"
#include <QtGui>
#include <QMessageBox>
#include <QString>
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()
{
if(ui->checkBox->isChecked())
{
QMessageBox::information(this,"Result","Cool another Male !");
}
if(ui->checkBox_2->isChecked())
{
QMessageBox::information(this,"Result", "Yay a female");
}
}
What I want to do is to make a third if()
which contains 2 variables, so that
in this case if none of the check boxes is checked to show a message, but I don't know how to use 2 variables in qt inside an if
like
if(2variableshere)
{
Do...
}