}
GaugeHSI {
id:hsi
- displayScale:pfd.displayScale
+// displayScale:pfd.displayScale
+// displayScale:0.9
visible:showHSI
- font.pixelSize:20
+ font.pixelSize:10
tickIncrement:30
tickMinor:5
color:indicatorColor
int xo=(width/2);
int yo=(height/2);
int arcsize=xo-5;
- painter->setTransform(QTransform().scale(m_scale,m_scale));
+ painter->setTransform(QTransform().translate(scenePos().x()+width/2,scenePos().y()+height/2).scale(m_scale,m_scale));
QTransform savematrix= painter->transform ();
QPen pen(m_color);
pen.setWidth(m_lineWidth);
QFontMetrics fm(m_font);
QPolygon needle;
- painter->setTransform(QTransform().translate(xo+scenePos().x()/m_scale, yo+scenePos().y()/m_scale),true);
+ //painter->setTransform(QTransform().translate(xo+scenePos().x()/m_scale, yo+scenePos().y()/m_scale),true);
painter->setBrush(backBrush);
painter->setPen(nopen);
painter->drawChord(QRect(-xo,-xo,2*xo,2*xo),0,360*16);
int labelWidth=fm.width(label);
int labelHeight=fm.height();
painter->setTransform(savematrix);
- painter->setTransform(QTransform().translate(xo+scenePos().x()/m_scale, yo+scenePos().y()/m_scale),true);
painter->drawArc(-arcsize,-arcsize,2*arcsize,2*arcsize,(int(m_lowPosition+270)%360)*-16,(int(m_highPosition+270)%360)*-16);
QPoint labelP=QPoint(0,-xo+15);
labelP=rotT.map(labelP);
// qDebug() << alpha << labelP << labelPd << labelPo << labelWidth << labelHeight;
painter->drawText(labelPd,label);
painter->drawLine(lineInP,lineOutP);
- alpha+=m_tickSpacing;
+ alpha+=m_tickSpacing?m_tickSpacing:10;
val+=m_tickIncrement;
}
needle+=QPoint(-5,0);
property url background: ""
// Background color is used when no background is set.
- property color backgroundColor: theme.inverted ? "#000000" : "#E0E1E2"
+// property color backgroundColor: theme.inverted ? "#000000" : "#E0E1E2"
+ property color backgroundColor: theme.inverted ? "#000000" : "#101010"
+
property url landscapeBackground: background
property url portraitBackground: background
#include "joystick.h"
#include "qdeclarativetoucharea.h"
#include <QList>
+#include <QObject>
+#include "qmlappviewer.h"
QString selectQmlMain(QStringList inportPaths,QString cmdParam,QString activeUI,uiListModel &uiList);
+
+
+
// MacOSX sdl hack so that SDL won't hijack main
#undef main
#ifdef QT_IOS
QString activeUi=mardroneSettings->value("activeUI","ardrone_plainqml.qml").toString();
#else
- QString activeUi=mardroneSettings->value("activeUI","ardrone_android.qml").toString();
+ QString activeUi=mardroneSettings->value("activeUI","ardrone_harmattan.qml").toString();
// QString activeUi=mardroneSettings->value("activeUI","ardrone_desktop.qml").toString();
#endif
qDebug() << "activeUI=" << activeUi;
setDefault=true;
};
- QDeclarativeView window;
+ // QDeclarativeView window;
+ QmlAppViewer window;
window.rootContext()->setContextProperty("MArdrone",window.window());
QObject::connect((QObject*)window.engine(), SIGNAL(quit()), &app, SLOT(quit()));
+
// Check available UI's
window.engine()->addImportPath(":/gauges/");
window.engine()->addImportPath("qrc:");
if((screenGeometry.height()<=800) && (screenGeometry.width()<=1024)) window.window()->showFullScreen();
else window.window()->show();
}
+ QObject::connect(&window, SIGNAL(backKey()), window.rootObject(), SLOT(backKey()));
return app.exec();
}
if(!validUi) activeUI=((uiListElement*)uiList.get(0))->file();
return(activeUI);
}
+
qdeclarativetoucharea.cpp \
gauges/gaugearc.cpp \
uilistelement.cpp \
- gauges/gaugehsi.cpp
+ gauges/gaugehsi.cpp \
+ qmlappviewer.cpp
INCLUDEPATH += dronelib \
gauges \
qdeclarativetoucharea.h \
gauges/gaugearc.h \
uilistelement.h \
- gauges/gaugehsi.h
+ gauges/gaugehsi.h \
+ qmlappviewer.h
+
system(pkg-config --exists sdl):!android{
message("I have sdl")
+
+