mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-07 23:43:42 +00:00
Move project, add simple test
This commit is contained in:
parent
a58b705f08
commit
8d66770acf
751 changed files with 249345 additions and 0 deletions
38
Software/PC_Application/LibreVNA-GUI/main.cpp
Normal file
38
Software/PC_Application/LibreVNA-GUI/main.cpp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#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[]) {
|
||||
|
||||
qSetMessagePattern("%{time process}: [%{type}] %{message}");
|
||||
|
||||
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();
|
||||
VirtualDevice::RegisterTypes();
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
signal(SIGINT, tryExitGracefully);
|
||||
#endif
|
||||
auto rc = app->exec();
|
||||
return rc;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue