From 36171a221ae72ff8471af261c6f0ce8dbaa056fd Mon Sep 17 00:00:00 2001 From: Carl Philipp Klemm Date: Sun, 26 Apr 2026 13:49:48 +0200 Subject: [PATCH] Allow running in headless mode when no display server is present --- src/main.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 722f6ed..e82b853 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,17 +14,14 @@ int main(int argc, char *argv[]) { - QApplication a(argc, argv); - - //pw_init(&argc, &argv); - - //set info QCoreApplication::setOrganizationName("UVOS"); QCoreApplication::setOrganizationDomain("uvos.xyz"); QCoreApplication::setApplicationName("SHinterface"); QCoreApplication::setApplicationVersion("0.6"); - QDir::setCurrent(a.applicationDirPath()); + QStringList args; + for(int i = 0; i < argc; ++i) + args<show(); } - retVal = a.exec(); + retVal = a->exec(); delete w; delete microDevice; @@ -131,9 +136,11 @@ int main(int argc, char *argv[]) QObject::connect(&w, &MainWindow::sigSave, mainObject.tcpClient, &TcpClient::sendItems); w.show(); - retVal = a.exec(); + retVal = a->exec(); } + delete a; + return retVal; }