mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +00:00
improved exception handling
This commit is contained in:
parent
5cd2fe00ab
commit
f07b7d17cd
1 changed files with 27 additions and 1 deletions
|
@ -1,11 +1,37 @@
|
||||||
|
|
||||||
#include "editor.hpp"
|
#include "editor.hpp"
|
||||||
|
|
||||||
|
#include <exception>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include <QtGui/QApplication>
|
#include <QtGui/QApplication>
|
||||||
|
|
||||||
|
class Application : public QApplication
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
bool notify (QObject *receiver, QEvent *event)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return QApplication::notify (receiver, event);
|
||||||
|
}
|
||||||
|
catch (const std::exception& exception)
|
||||||
|
{
|
||||||
|
std::cerr << "An exception has been caught: " << exception.what() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
Application (int& argc, char *argv[]) : QApplication (argc, argv) {}
|
||||||
|
};
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication mApplication (argc, argv);
|
Application mApplication (argc, argv);
|
||||||
|
|
||||||
CS::Editor editor;
|
CS::Editor editor;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue