From 0c4de36b43a919ec6a02bcb2af4e498e776db71e Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Wed, 16 Jul 2014 23:06:17 -0700 Subject: [PATCH] Fixed apmtoolbar. --- src/ui/apmtoolbar.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/ui/apmtoolbar.cpp b/src/ui/apmtoolbar.cpp index cd5ffb8be..78795b818 100644 --- a/src/ui/apmtoolbar.cpp +++ b/src/ui/apmtoolbar.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #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))); -- 2.22.0