35 lines
810 B
C++
35 lines
810 B
C++
#include "appwindow.h"
|
|
#include <QtWidgets/QApplication>
|
|
#include "Device/device.h"
|
|
#ifdef Q_OS_UNIX
|
|
#include <signal.h>
|
|
#endif
|
|
|
|
static QApplication *app;
|
|
static AppWindow *window;
|
|
|
|
#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);
|
|
QCoreApplication::setOrganizationName("LibreVNA");
|
|
QCoreApplication::setApplicationName("LibreVNA-GUI");
|
|
window = new AppWindow;
|
|
QCoreApplication::setApplicationVersion(window->getAppVersion() + "-" +
|
|
window->getAppGitHash().left(9));
|
|
|
|
Device::RegisterTypes();
|
|
|
|
#ifdef Q_OS_UNIX
|
|
signal(SIGINT, tryExitGracefully);
|
|
#endif
|
|
auto rc = app->exec();
|
|
return rc;
|
|
}
|