35 #include <QSvgRenderer>
36 #include <QtCore/qfileinfo.h>
37 #include <QtCore/qdir.h>
40 #include <QQmlContext>
45 setResizeMode(SizeRootObjectToView);
52 foreach (
const QVector<UAVObject *> &objInst, objects)
53 engine()->rootContext()->setContextProperty(objInst.at(0)->getName(), objInst.at(0));
55 engine()->rootContext()->setContextProperty(
"qmlWidget",
this);
66 engine()->removeImageProvider(
"svg");
68 engine()->addImageProvider(
"svg", svgProvider);
70 engine()->clearComponentCache();
73 engine()->rootContext()->setContextProperty(
"svgRenderer", svgProvider);
74 engine()->setBaseUrl(QUrl::fromLocalFile(fn));
76 qDebug() << Q_FUNC_INFO << fn;
77 setSource(QUrl::fromLocalFile(fn));
79 foreach (
const QQmlError &
error, errors()) {
80 qDebug() << error.description();
87 if (event->button() == Qt::MiddleButton) {
91 QQuickView::mouseReleaseEvent(event);
QmlViewGadgetWidget(QWindow *parent=nullptr)
QVector< QVector< UAVObject * > > getObjectsVector()
Core plugin system that manages the plugins, their life cycle and their registered objects...
void mouseReleaseEvent(QMouseEvent *event)
void setQmlFile(QString fn)
else error('Your technical computing program does not support file choosers.Please input the file name in the argument. ') end elseif nargin >0 logfile