+ QDeclarativeView window;
+ window.rootContext()->setContextProperty("MArdrone",window.window());
+ QObject::connect((QObject*)window.engine(), SIGNAL(quit()), &app, SLOT(quit()));
+ // Check available UI's
+ window.engine()->addImportPath("qrc:/gauges/");
+ window.engine()->addImportPath("qrc:");
+ window.engine()->addImportPath("gauges");
+ window.engine()->addImportPath(".");
+ qDebug() << "ImportPathList" << window.engine()->importPathList() << window.engine()->importPathList();;
+ QStringList importPath=window.engine()->importPathList();
+ QString qmlFile=QString("qrc:/")+selectQmlMain(importPath,qmlmainfile,activeUi);
+ qDebug() << "using:" << qmlFile;
+
+ if(qmlFile.contains("desktop")) { // We have desktop UI
+ QDeclarativeComponent component(window.engine(),QUrl(qmlFile));
+ if(component.isError()) qDebug() << component.errors(); else
+ QObject *myObject = component.create();
+ } else { // We have Mobile UI
+ window.setSource(QUrl(qmlFile));
+ QRect screenGeometry=QApplication::desktop()->screenGeometry();
+ window.setAttribute(Qt::WA_LockLandscapeOrientation, true);
+ if((screenGeometry.height()<=800) && (screenGeometry.width()<=1024)) window.window()->showFullScreen();
+ else window.window()->show();
+ }