void CMain::doMain() {
// check that the message box is working as expected!
QMessageBox::information(nullptr,
"Test Msgbox", tr
("Qt Version: %1").
arg(QT_VERSION_STR
));
// THIS QFILEDIALOG BREAKS SOMETHING!
// comment the next line out to see everything working normal!
// you'll hear the message box sound, but don't see anything
QMessageBox::warning(nullptr,
"Test Msgbox 2",
"Hi, I'm another msg box");
// the error msg will show up, but it will stay "unusable" in the background
// also the program will execute the following file dialog at the same time without waiting
ErrMsg.setModal(true);
ErrMsg.showMessage(tr("This is some sort of error message"));
ErrMsg.exec();
// this pops up too early
cout << "doMain() done. Time to quit()." << endl;
qApp->quit();
}//end method
void CMain::doMain() {
// check that the message box is working as expected!
QMessageBox::information(nullptr, "Test Msgbox", tr("Qt Version: %1").arg(QT_VERSION_STR));
// THIS QFILEDIALOG BREAKS SOMETHING!
// comment the next line out to see everything working normal!
QFileDialog::getOpenFileName(nullptr, "Open some file", QString(), tr("All files (*.*)"), nullptr, QFileDialog::ReadOnly);
// you'll hear the message box sound, but don't see anything
QMessageBox::warning(nullptr, "Test Msgbox 2", "Hi, I'm another msg box");
// the error msg will show up, but it will stay "unusable" in the background
// also the program will execute the following file dialog at the same time without waiting
QErrorMessage ErrMsg;
ErrMsg.setModal(true);
ErrMsg.showMessage(tr("This is some sort of error message"));
ErrMsg.exec();
// this pops up too early
QFileDialog::getOpenFileName(nullptr, "Open another file", QString(), tr("All files (*.*)"), nullptr, QFileDialog::ReadOnly);
cout << "doMain() done. Time to quit()." << endl;
qApp->quit();
}//end method
To copy to clipboard, switch view to plain text mode
Bookmarks