20 #include <QCoreApplication> 33 fprintf(stderr,
"quit the application by signal(%d).\n", sig);
34 QCoreApplication::quit();
39 sigset_t blocking_mask;
40 sigemptyset(&blocking_mask);
42 for (std::vector<int>::const_iterator it = quitSignals.begin(); it != quitSignals.end(); ++it) {
43 sigaddset(&blocking_mask, *it);
48 sa.sa_mask = blocking_mask;
51 for (std::vector<int>::const_iterator it = quitSignals.begin(); it != quitSignals.end(); ++it) {
52 sigaction(*it, &sa, 0);
59 QCoreApplication a(argc, argv);
61 QCoreApplication::setOrganizationName(COMPANY);
62 QCoreApplication::setApplicationName(
"SDRangelBench");
63 QCoreApplication::setApplicationVersion(SDRANGEL_VERSION);
66 int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP};
67 std::vector<int> vsig(catchSignals, catchSignals +
sizeof(catchSignals) /
sizeof(
int));
74 #if QT_VERSION >= 0x050400 75 qInfo(
"%s %s Qt %s %db %s %s DSP Rx:%db Tx:%db PID %lld",
76 qPrintable(QCoreApplication::applicationName()),
77 qPrintable(QCoreApplication::applicationVersion()),
78 qPrintable(QString(QT_VERSION_STR)),
80 qPrintable(QSysInfo::currentCpuArchitecture()),
81 qPrintable(QSysInfo::prettyProductName()),
84 QCoreApplication::applicationPid());
86 qInfo(
"%s %s Qt %s %db DSP Rx:%db Tx:%db PID %lld",
87 qPrintable(QCoreApplication::applicationName()),
88 qPrintable((QCoreApplication::>applicationVersion()),
89 qPrintable(QString(QT_VERSION_STR)),
93 QCoreApplication::applicationPid());
99 QObject::connect(&m, SIGNAL(finished()), &a, SLOT(quit()));
101 QTimer::singleShot(0, &m, SLOT(run()));
106 int main(
int argc,
char* argv[])
110 int res = runQtApplication(argc, argv, logger);
111 qWarning(
"SDRangel quit.");
void parse(const QCoreApplication &app)
void catchUnixSignals(const std::vector< int > &quitSignals)
int main(int argc, char *argv[])