1 /*==================================================================
3 ! mardrone application AR-Drone for MeeGo
5 ! Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
8 ! Author:Kate Alhola kate.alhola@nokia.com
10 ! GNU Lesser General Public License Usage
11 ! This file may be used under the terms of the GNU Lesser
12 ! General Public License version 2.1 as published by the Free Software
13 ! Foundation and appearing in the file LICENSE.LGPL included in the
14 ! packaging of this file. Please review the following information to
15 ! ensure the GNU Lesser General Public License version 2.1 requirements
16 ! will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
20 *===================================================================*/
21 #include <QtGui/QApplication>
22 #include "dronecontrol.h"
24 #include "gaugehorizon.h"
25 #include <QDeclarativeView>
26 #include <QDeclarativeContext>
27 #include <QDeclarativeEngine>
28 #include <QtDeclarative>
29 #include <QtComponents/qdeclarativewindow.h>
31 int main(int argc, char *argv[])
33 qmlRegisterType<DroneControl>("Drone", 1, 0, "DroneControl");
34 qmlRegisterType<DroneVideo>("Drone", 1, 0, "DroneVideo");
35 qmlRegisterType<GaugeHorizon>("Drone", 1, 0, "GaugeHorizon");
36 QApplication app(argc, argv);
39 qDebug() << "./ardrone.qml exists " << QFile("ardrone.qml").exists();
40 qDebug() << ":/ardrone.qml exists " << QFile(":/ardrone.qml").exists();
42 if(QFile("ardrone.qml").exists()) {
43 QDir::setCurrent(app.applicationDirPath());
44 url=new QUrl(QUrl::fromLocalFile("ardrone.qml"));
47 QDir::setCurrent(":/");
48 url=new QUrl("qrc:/ardrone.qml");
50 QDeclarativeWindow window(*url);
51 window.window()->show();