11#include <QLoggingCategory>
12#if defined(Q_OS_ANDROID)
13#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
15#elif QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
22 #include "RabbitCommonTools.h"
23 #include "FrmUpdater.h"
24 #include "RabbitCommonDir.h"
27#include "LunarCalendar.h"
29static Q_LOGGING_CATEGORY(Logger,
"App.main")
38int main(
int argc,
char *argv[])
40 QApplication a(argc, argv);
41 a.setApplicationVersion(LunarCalendar_VERSION);
42 a.setApplicationName(
"LunarCalendar");
45 RabbitCommon::CTools::Instance()->Init();
47 RabbitCommon::CTools::Instance()->InstallTranslator(
"LunarCalendarApp");
49 a.setApplicationDisplayName(QObject::tr(
"Calendar"));
51 qInfo(Logger) << QObject::tr(
"Calendar") +
" " + CLunarCalendar::Version()
52 << QObject::tr(
"Rabbit Common: ")
53 + RabbitCommon::CTools::Version();
56 CFrmUpdater *pUpdate =
new CFrmUpdater();
57 QIcon icon = QIcon::fromTheme(
"calendar");
59 auto sizeList = icon.availableSizes();
60 if(!sizeList.isEmpty()) {
61 QPixmap p = icon.pixmap(*sizeList.begin());
62 pUpdate->SetTitle(p.toImage());
66 if(a.arguments().size() > 1) {
67 if(!pUpdate->GenerateUpdateJson())
69 if(!pUpdate->GenerateUpdateXml())
76#if defined (Q_OS_ANDROID)
79 #if defined (Q_OS_UNIX)
80 QRect rect = qApp->primaryScreen()->geometry();
81 int left = (rect.width() - 500) >> 1;
82 int top = (rect.height() - 500) >> 1;
[Define CTaskHandler derived class]