2 * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
3 * Copyright (c) 2018 TOYOTA MOTOR CORPORATION
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include <QGuiApplication>
19 #include <QCommandLineParser>
20 #include <QtCore/QUrlQuery>
21 #include <QtGui/QGuiApplication>
22 #include <QtQml/QQmlApplicationEngine>
23 #include <QtQml/QQmlContext>
24 #include <QtQml/qqml.h>
25 #include <QQuickWindow>
28 #include "applicationmodel.h"
30 #include "homescreenhandler.h"
32 int main(int argc, char *argv[])
34 QString myname = QString("launcher");
35 QGuiApplication a(argc, argv);
37 // necessary to identify correctly by app_id
38 a.setDesktopFileName(myname);
40 // import C++ class to QML
41 qmlRegisterType<ApplicationModel>("AppModel", 1, 0, "ApplicationModel");
43 HomescreenHandler* homescreenHandler = new HomescreenHandler();
46 QQmlApplicationEngine engine;
47 engine.rootContext()->setContextProperty(QStringLiteral("homescreenHandler"), homescreenHandler);
48 engine.load(QUrl(QStringLiteral("qrc:/Launcher.qml")));
49 homescreenHandler->getRunnables();