diff --git a/emulator/main.c b/emulator/main.c deleted file mode 100644 index 0a8e2a6..0000000 --- a/emulator/main.c +++ /dev/null @@ -1,9 +0,0 @@ - -extern void qt_init(int argc, char* argv[]); -extern int qt_execute(); - - -int main(int argc, char* argv[]) { - qt_init(argc,argv); - return qt_execute(); -} diff --git a/emulator/qt/main.cpp b/emulator/qt/main.cpp index 6e5551b..b3b8f97 100644 --- a/emulator/qt/main.cpp +++ b/emulator/qt/main.cpp @@ -1,21 +1,12 @@ #include #include - extern "C" { - void qt_init(int argc, char* argv[]); //Will be called at the top of the main() function - int qt_execute(); //Will be called after calling qt_execute + //C Functions from the common folder void app_init(); //Initializes the app void app_process(); //Processes one eventloop of the app } -QApplication* app_ptr=NULL; - -void qt_init(int argc, char* argv[]) { - app_ptr = new QApplication(argc,argv); - app_init(); -} - void app_loop() { while(!QApplication::closingDown()) { app_process(); @@ -23,9 +14,13 @@ void app_loop() { } } -int qt_execute() { +int main(int argc, char* argv[]) { + QApplication app(argc,argv); + app_init(); + QtConcurrent::run(&app_loop); - int ret= app_ptr->exec(); - delete app_ptr; - return ret; + return app.exec(); } + + +