2
* Copyright (C) 2012-2015 Canonical, Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
#include <QCommandLineParser>
19
#include <QtQuick/QQuickView>
20
#include <QtGui/QGuiApplication>
21
#include <QtQml/QQmlEngine>
22
#include <QtQml/QQmlContext>
29
#include <private/qobject_p.h>
31
// REMOVEME - Should be able to use qmlscene, but in order to use the mir benchmarking we need
32
// to parse command line switches. Wait until MIR_SOCKET supported by the benchmark framework.
34
int main(int argc, const char *argv[])
36
setenv("QT_QPA_PLATFORM_PLUGIN_PATH", qPrintable(::qpaPluginDirectory()), 1 /* overwrite */);
37
setenv("QT_QPA_PLATFORM", "mirserver", 1 /* overwrite */);
39
QGuiApplication::setApplicationName("qml-demo-shell");
40
QGuiApplication *application;
42
application = new QGuiApplication(argc, (char**)argv);
43
QQuickView* view = new QQuickView();
44
view->engine()->addImportPath(::qmlPluginDirectory());
45
view->setResizeMode(QQuickView::SizeRootObjectToView);
46
view->setColor("lightgray");
47
view->setTitle("Demo Shell");
49
QUrl source(::qmlDirectory() + "qml-demo-shell/windowModel.qml");
51
view->setSource(source);
52
QObject::connect(view->engine(), SIGNAL(quit()), application, SLOT(quit()));
54
view->showFullScreen();
55
int result = application->exec();