ich bin neu was Qt betrifft. Wie kann ich in Qt Exceptions handhaben?
Bin es von Borland C++ und Visual C++ gewohnt, dass ich ähnliches wie folgt machen kann:
Code: Alles auswählen
int main(int argc, char *argv[])
{
try{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}catch(...){
QMessageBox msgBox;
msgBox.setText("error");
msgBox.exec();
}
return -1;
}
//---------------------------------------
void MainWindow::on_pushButton_clicked()
{
throw new std::string("it's the end of the world!");
}
Habe auch bereis in der *.pro Datei folgendes eingefügt:
Code: Alles auswählen
CONFIG += qt
CONFIG += warn_on
CONFIG += exceptions
CONFIG += debug
Kann Qt keine Exceptions?
Besten Dank im Voraus.
Liebe Grüße
Ricardo Cescon
- Software Engineer -