22 #include <QSvgRenderer>
23 #include <QtCore/qfileinfo.h>
24 #include <QtCore/qdir.h>
25 #include <QMouseEvent>
28 #include <QQmlContext>
29 #include "stabilizationdesired.h"
34 setResizeMode(SizeRootObjectToView);
36 objectsToExport <<
"VelocityActual"
39 <<
"AttitudeSimulated"
44 <<
"StabilizationDesired"
50 <<
"GCSTelemetryStats"
51 <<
"FlightBatteryState";
56 foreach (
const QString &objectName, objectsToExport) {
57 exportUAVOInstance(objectName, 0);
61 engine()->rootContext()->setContextProperty(
"qmlWidget",
this);
73 void PfdQmlGadgetWidget::exportUAVOInstance(
const QString &objectName,
int instId)
77 engine()->rootContext()->setContextProperty(objectName,
object);
79 qWarning() <<
"[PFDQML] Failed to load object" << objectName;
87 void PfdQmlGadgetWidget::resetUAVOExport(
const QString &objectName,
int instId)
91 engine()->rootContext()->setContextProperty(objectName,
nullptr);
93 qWarning() <<
"Failed to load object" << objectName;
100 engine()->removeImageProvider(
"svg");
102 engine()->addImageProvider(
"svg", svgProvider);
104 engine()->clearComponentCache();
107 engine()->rootContext()->setContextProperty(
"svgRenderer", svgProvider);
108 engine()->setBaseUrl(QUrl::fromLocalFile(fn));
110 setSource(QUrl::fromLocalFile(fn));
112 foreach (
const QQmlError &
error, errors()) {
113 qDebug() << error.description();
119 engine()->rootContext()->setContextProperty(
"settings", settings);
125 if (event->button() == Qt::MiddleButton) {
129 QQuickView::mouseReleaseEvent(event);
Core plugin system that manages the plugins, their life cycle and their registered objects...
else error('Your technical computing program does not support file choosers.Please input the file name in the argument. ') end elseif nargin >0 logfile
UAVObject * getObject(const QString &name, quint32 instId=0)