Merge pull request #105 from sophiekovalevsky/improving-app
gui/main: adjustments
This commit is contained in:
commit
5f0f99cfbf
@ -1,21 +1,19 @@
|
||||
#include "appwindow.h"
|
||||
#include "Calibration/calkit.h"
|
||||
#include "touchstone.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include <QtWidgets/QApplication>
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <signal.h>
|
||||
#include <complex>
|
||||
#endif
|
||||
|
||||
static QApplication *app;
|
||||
static AppWindow *window;
|
||||
|
||||
void sig_handler(int s) {
|
||||
#ifdef Q_OS_UNIX
|
||||
static void tryExitGracefully(int s) {
|
||||
Q_UNUSED(s)
|
||||
window->close();
|
||||
app->quit();
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
app = new QApplication(argc, argv);
|
||||
@ -24,7 +22,10 @@ int main(int argc, char *argv[]) {
|
||||
window = new AppWindow;
|
||||
QCoreApplication::setApplicationVersion(window->getAppVersion() + "-" +
|
||||
window->getAppGitHash().left(9));
|
||||
signal(SIGINT, sig_handler);
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
signal(SIGINT, tryExitGracefully);
|
||||
#endif
|
||||
auto rc = app->exec();
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user