2 * \file ConsoleApplicationPrivate.h
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
11 #ifndef CONSOPLEAPPLICATIONPRIVATE_H
12 #define CONSOPLEAPPLICATIONPRIVATE_H
14 #include "support/qstring_helpers.h"
16 #include <QCoreApplication>
19 #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
20 #include <QRandomGenerator>
30 class ConsoleApplication;
32 class ConsoleApplicationPrivate : public QCoreApplication
36 ConsoleApplicationPrivate(ConsoleApplication * owner,
37 std::string const & app, int & argc, char ** argv)
38 : QCoreApplication(argc, argv), owner_(owner)
40 setOrganizationName("LyX");
41 setOrganizationDomain("lyx.org");
42 setApplicationName(toqstr(app));
44 #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
45 QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
47 qsrand(QDateTime::currentDateTime().toTime_t());
52 // set timer to do the work asynchronously after the event
54 QTimer::singleShot(0, this, SLOT(doExec()));
64 ConsoleApplication * owner_;
68 } // namespace support
71 #endif // CONSOPLEAPPLICATIONPRIVATE_H