AndresBarbaRoja
17th June 2011, 16:42
Good day,
I need to create a non-modal dialog on which I can present error messages as they are received. The idea is to open a new window if I get an error and to add lines to the detailed description if any new error is reported while the dialog is still open.
I subclassed the QMessageBox to make it singleton and then the code that calls the window is something like this
void MainWindow::on_pushButton_clicked()
{
errWind = ErrorWindow::Instance();
errWind->setModal(false);
errWind->setText("Errores:");
QString msg = errWind->detailedText();
msg.append("ERROR\n");
errWind->setDetailedText(msg);
errWind->show();
// int ret = errWind->exec();
// if(ret==QMessageBox::Ok)
// errWind->setDetailedText("");
}
The commented code is there because I wan to clean the detailedText when the ok button is pushed, but the exec() makes the window modal and that does not work for me.
How can I clear the detailed text on Ok button pushed?
I already tried overloading the done() and the accepted() functions, but that does not worked for me.
Thanks in advance for any idea
I need to create a non-modal dialog on which I can present error messages as they are received. The idea is to open a new window if I get an error and to add lines to the detailed description if any new error is reported while the dialog is still open.
I subclassed the QMessageBox to make it singleton and then the code that calls the window is something like this
void MainWindow::on_pushButton_clicked()
{
errWind = ErrorWindow::Instance();
errWind->setModal(false);
errWind->setText("Errores:");
QString msg = errWind->detailedText();
msg.append("ERROR\n");
errWind->setDetailedText(msg);
errWind->show();
// int ret = errWind->exec();
// if(ret==QMessageBox::Ok)
// errWind->setDetailedText("");
}
The commented code is there because I wan to clean the detailedText when the ok button is pushed, but the exec() makes the window modal and that does not work for me.
How can I clear the detailed text on Ok button pushed?
I already tried overloading the done() and the accepted() functions, but that does not worked for me.
Thanks in advance for any idea