-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
61 lines (53 loc) · 1.84 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/** @file main.cpp
*
* OpenICC Taxi DB is a color profile DB browser.
*
* @par Copyright:
* 2015-2017 (C) Kai-Uwe Behrmann
* All Rights reserved.
*
* @par License:
* AGPL-3.0 <https://opensource.org/licenses/AGPL-3.0>
* @since 2015/10/22
*
* basic QML handling and environment setup
*/
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
#include <QtQml> // qmlRegisterType<>()
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlComponent>
#include <QtQml/QQmlContext>
#include <QtQuick/QQuickWindow>
#include <QtCore/QUrl>
#include <QDebug>
#include "include/iccopen.h"
int main(int argc, char* argv[])
{
QGuiApplication app(argc, argv);
app.setApplicationName(QString("OpenICC Taxi DB Viewer"));
app.setApplicationDisplayName(QString("ICC Taxi DB"));
app.setApplicationVersion("1.0.0");
app.setOrganizationName(QString("oyranos.com"));
#ifdef Q_OS_ANDROID
QIcon icon(QStringLiteral(":/extras/images/logo.png"));
#else
QIcon icon(QStringLiteral(":/extras/images/logo-color-src.svg"));
#endif
app.setWindowIcon(icon);
foreach (QScreen * screen, QGuiApplication::screens())
screen->setOrientationUpdateMask(Qt::LandscapeOrientation | Qt::PortraitOrientation |
Qt::InvertedLandscapeOrientation | Qt::InvertedPortraitOrientation);
qmlRegisterType<IccOpen>("IccOpen", 1, 0, "IccOpen");
QQmlEngine engine;
QQmlComponent component(&engine);
QQuickWindow::setDefaultAlphaBuffer(true);
component.loadUrl(QUrl("qrc:///qml/IccTaxiDB.qml"));
if ( component.isReady() )
component.create();
else
qWarning() << component.errorString();
QQmlContext *ctxt = engine.rootContext();
ctxt->setContextProperty("ApplicationVersion", QVariant::fromValue( app.applicationVersion() ));
return app.exec();
}