rookee
9th December 2015, 15:34
Hello All,
I'm trying to make the checkBox status back to checked again if users selection is "NO" on the pop up message window. I also want to flash messages when the selection is done. Please help. Thanks in advance.
void MainWindow::on_checkBox_clicked()
{
if(ui->checkBox->isChecked())
{
cbx=1;
//Something
} if(!ui->checkBox->isChecked()){
QMessageBox::StandardButton reply;
reply = QMessageBox::question(this,"Test", "Do you want to stop logging?", QMessageBox::Yes|QMessageBox::No);
if(reply==QMessageBox::Yes){
// A message should flash saying "Logging is stopped"
qDebug()<< "Logging is stopped";
cbx=0;
}else {
qDebug()<<"Logging will continue";
// A message should flash saying "Logging will continue" and Keep the checkBox status back to checked again.
}
}
}
Can someone help me understand what qDebug statements are used for. The following is what I read on the Qt website. I couldn't get it, if someone can explain it little more detailed I would really appreciate it. Can I use qDebug to flash the messages that I want to.
The QDebug class provides an output stream for debugging information.
QDebug is used whenever the developer needs to write out debugging or tracing information to a device, file, string or console.
I'm trying to make the checkBox status back to checked again if users selection is "NO" on the pop up message window. I also want to flash messages when the selection is done. Please help. Thanks in advance.
void MainWindow::on_checkBox_clicked()
{
if(ui->checkBox->isChecked())
{
cbx=1;
//Something
} if(!ui->checkBox->isChecked()){
QMessageBox::StandardButton reply;
reply = QMessageBox::question(this,"Test", "Do you want to stop logging?", QMessageBox::Yes|QMessageBox::No);
if(reply==QMessageBox::Yes){
// A message should flash saying "Logging is stopped"
qDebug()<< "Logging is stopped";
cbx=0;
}else {
qDebug()<<"Logging will continue";
// A message should flash saying "Logging will continue" and Keep the checkBox status back to checked again.
}
}
}
Can someone help me understand what qDebug statements are used for. The following is what I read on the Qt website. I couldn't get it, if someone can explain it little more detailed I would really appreciate it. Can I use qDebug to flash the messages that I want to.
The QDebug class provides an output stream for debugging information.
QDebug is used whenever the developer needs to write out debugging or tracing information to a device, file, string or console.