KOSMIndoorMap

main.cpp
1 /*
2  SPDX-FileCopyrightText: 2021 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include <kosmindoormap_version.h>
8 
9 #include <KLocalizedContext>
10 #include <KLocalizedString>
11 
12 #include <QQmlApplicationEngine>
13 #include <QQmlContext>
14 
15 #ifdef Q_OS_ANDROID
16 #include <QGuiApplication>
17 #include <QQuickStyle>
18 #else
19 #include <QApplication>
20 #endif
21 
22 #include <QIcon>
23 
24 #ifdef Q_OS_ANDROID
25 Q_DECL_EXPORT
26 #endif
27 int main(int argc, char **argv)
28 {
29  QCoreApplication::setApplicationName(QStringLiteral("kosmindoormap"));
30  QCoreApplication::setOrganizationName(QStringLiteral("KDE"));
31  QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org"));
32  QCoreApplication::setApplicationVersion(QStringLiteral(KOSMINDOORMAP_VERSION_STRING));
33 
36 #ifdef Q_OS_ANDROID
37  QGuiApplication app(argc, argv);
38  QQuickStyle::setStyle(QStringLiteral("Material"));
39 #else
40  QApplication app(argc, argv); // for native file dialogs
41 #endif
42  QGuiApplication::setApplicationDisplayName(QStringLiteral("KDE OSM Indoor Map"));
43  QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("go-home")));
44 
45  QQmlApplicationEngine engine;
46  auto l10nContext = new KLocalizedContext(&engine);
47  l10nContext->setTranslationDomain(QStringLiteral(TRANSLATION_DOMAIN));
48  engine.rootContext()->setContextObject(l10nContext);
49 
50  engine.load(QStringLiteral("qrc:/indoormap.qml"));
51  return app.exec();
52 }
void setWindowIcon(const QIcon &icon)
void setOrganizationDomain(const QString &orgDomain)
void setAttribute(Qt::ApplicationAttribute attribute, bool on)
void setApplicationVersion(const QString &version)
AA_EnableHighDpiScaling
QQmlContext * rootContext() const const
void setContextObject(QObject *object)
void setStyle(const QString &style)
void load(const QUrl &url)
QIcon fromTheme(const QString &name)
void setOrganizationName(const QString &orgName)
void setApplicationDisplayName(const QString &name)
void setApplicationName(const QString &application)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 25 2021 23:04:00 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.