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

Fixed apmtoolbar.

parent f3b414ed
#include <QDebug>
#include <QQmlContext>
#include <QGraphicsObject>
#include <QQuickItem>
#include "LinkManager.h"
#include "MainWindow.h"
......@@ -21,7 +22,7 @@ APMToolBar::APMToolBar(QWidget *parent):
setSource(QUrl::fromLocalFile("qml/ApmToolBar.qml"));
#endif
setResizeMode(QQuickView::SizeRootObjectToView);
this->rootContext()->setContextProperty("globalObj", this);
rootContext()->setContextProperty("globalObj", this);
connect(LinkManager::instance(),SIGNAL(newLink(LinkInterface*)),
this, SLOT(updateLinkDisplay(LinkInterface*)));
......@@ -55,8 +56,7 @@ void APMToolBar::activeUasSet(UASInterface *uas)
}
void APMToolBar::armingChanged(bool armed)
{
// FIXME: This doesn't work in Qt5, figure out what it should be
//this->rootObject()->setProperty("armed",armed);
rootObject()->setProperty("armed", armed);
}
void APMToolBar::armingChanged(int sysId, QString armingState)
......@@ -162,9 +162,7 @@ void APMToolBar::connectMAV()
void APMToolBar::setConnection(bool connection)
{
// Change the image to represent the state
// FIXME: Doesn't work the same in Qt5, fix this
//QObject *object = rootObject();
//object->setProperty("connected", connection);
rootObject()->setProperty("connected", connection);
}
APMToolBar::~APMToolBar()
......@@ -200,17 +198,14 @@ void APMToolBar::showConnectionDialog()
void APMToolBar::updateLinkDisplay(LinkInterface* newLink)
{
qDebug() << "APMToolBar: updateLinkDisplay";
// FIXME: Doesn't work the same in Qt5, fix this.
//QObject *object = rootObject();
QObject *object = rootObject();
if (newLink && rootObject()){
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();
// FIXME: Doesn't work in Qt5
//object->setProperty("linkNameLabel", linkName);
object->setProperty("linkNameLabel", linkName);
connect(newLink, SIGNAL(connected(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