Commit 0c4de36b authored by Bryant Mairs's avatar Bryant Mairs

Fixed apmtoolbar.

parent f3b414ed
#include <QDebug> #include <QDebug>
#include <QQmlContext> #include <QQmlContext>
#include <QGraphicsObject> #include <QGraphicsObject>
#include <QQuickItem>
#include "LinkManager.h" #include "LinkManager.h"
#include "MainWindow.h" #include "MainWindow.h"
...@@ -21,7 +22,7 @@ APMToolBar::APMToolBar(QWidget *parent): ...@@ -21,7 +22,7 @@ APMToolBar::APMToolBar(QWidget *parent):
setSource(QUrl::fromLocalFile("qml/ApmToolBar.qml")); setSource(QUrl::fromLocalFile("qml/ApmToolBar.qml"));
#endif #endif
setResizeMode(QQuickView::SizeRootObjectToView); setResizeMode(QQuickView::SizeRootObjectToView);
this->rootContext()->setContextProperty("globalObj", this); rootContext()->setContextProperty("globalObj", this);
connect(LinkManager::instance(),SIGNAL(newLink(LinkInterface*)), connect(LinkManager::instance(),SIGNAL(newLink(LinkInterface*)),
this, SLOT(updateLinkDisplay(LinkInterface*))); this, SLOT(updateLinkDisplay(LinkInterface*)));
...@@ -55,8 +56,7 @@ void APMToolBar::activeUasSet(UASInterface *uas) ...@@ -55,8 +56,7 @@ void APMToolBar::activeUasSet(UASInterface *uas)
} }
void APMToolBar::armingChanged(bool armed) void APMToolBar::armingChanged(bool armed)
{ {
// FIXME: This doesn't work in Qt5, figure out what it should be rootObject()->setProperty("armed", armed);
//this->rootObject()->setProperty("armed",armed);
} }
void APMToolBar::armingChanged(int sysId, QString armingState) void APMToolBar::armingChanged(int sysId, QString armingState)
...@@ -162,9 +162,7 @@ void APMToolBar::connectMAV() ...@@ -162,9 +162,7 @@ void APMToolBar::connectMAV()
void APMToolBar::setConnection(bool connection) void APMToolBar::setConnection(bool connection)
{ {
// Change the image to represent the state // Change the image to represent the state
// FIXME: Doesn't work the same in Qt5, fix this rootObject()->setProperty("connected", connection);
//QObject *object = rootObject();
//object->setProperty("connected", connection);
} }
APMToolBar::~APMToolBar() APMToolBar::~APMToolBar()
...@@ -200,17 +198,14 @@ void APMToolBar::showConnectionDialog() ...@@ -200,17 +198,14 @@ void APMToolBar::showConnectionDialog()
void APMToolBar::updateLinkDisplay(LinkInterface* newLink) void APMToolBar::updateLinkDisplay(LinkInterface* newLink)
{ {
qDebug() << "APMToolBar: updateLinkDisplay"; qDebug() << "APMToolBar: updateLinkDisplay";
// FIXME: Doesn't work the same in Qt5, fix this. QObject *object = rootObject();
//QObject *object = rootObject();
if (newLink && rootObject()){ if (newLink && rootObject()){
qint64 baudrate = newLink->getConnectionSpeed(); qint64 baudrate = newLink->getConnectionSpeed();
// FIXME: Doesn't work in Qt5 object->setProperty("baudrateLabel", QString::number(baudrate));
//object->setProperty("baudrateLabel", QString::number(baudrate));
QString linkName = newLink->getName(); QString linkName = newLink->getName();
// FIXME: Doesn't work in Qt5 object->setProperty("linkNameLabel", linkName);
//object->setProperty("linkNameLabel", linkName);
connect(newLink, SIGNAL(connected(bool)), connect(newLink, SIGNAL(connected(bool)),
this, SLOT(setConnection(bool))); this, SLOT(setConnection(bool)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment